无法从 jenkins 控制台输出文件中获取值。

问题描述 投票:0回答:1

我需要从我的Jenkins控制台输出中获取值并将其保存到一个变量中。以下是我的代码

stage('Publish') {
    steps 
    {
        script
        {
      bat 'gradle publish'
        }
      def out = bat(script:"gradle publish", returnStdout: true )
     Pattern p = Pattern.compile("INFO] Upload: .*zip")
    Matcher m = p.matcher(out);
    echo "value to be printed"
    echo out 

我需要从控制台输出中保存一个值,如上传 http:/localhost:8081repositorymaven-snapscshotomxxxxxx.zip。

jenkins jenkins-pipeline
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.