Jenkins中shell向Groovy传递变量

  • Post author:
  • Post category:技术
  • Post comments:0评论

我只写流水线中主要的配置部分

environment {
    VERSION=""
}
stages {
    stage('随便吧') {
        steps {
            script{
                VERSION = sh (
                    script: '''
                    XXXX
                    ''',
                    returnStdout: true
                ).trim()
            }
        }
    }
}

参考

https://www.jianshu.com/p/2cdc8efedf2f

0 0 votes
文章评分
订阅
提醒
guest
0 评论
最旧
最新 得票最多