简体   繁体   English

AWS CloudFormation 输出到 JenkinsFile 管道

[英]AWS CloudFormation outputs to JenkinsFile pipeline

I have cloudFormation.yaml and JenkinsFile.groovy.我有 cloudFormation.yaml 和 JenkinsFile.groovy。 In cloudFormation has outputs:在 cloudFormation 有输出:

Outputs:
  bucketName:
    Value: !Ref BucketName
    Description: 'bucket name'

I run cloudFormation:我运行 cloudFormation:

stage("run cloudFormation") {
            steps {
                script {
                    withAWS(credentials: awsCredentials) {
                        cfnUpdate(
                            stack: stackName,
                            file: "cloudFormation.yaml",
                            params: [
                                "uniqString=${uniqString}"
                            ],
                            timeoutInMinutes: 10,
                            pollInterval: 600
                        )
                    }
                }
            }
        }

How can I get outputs backetName in my JenkinsFile?如何在我的 JenkinsFile 中获取输出 backetName?

I believe you can just assign it to a var我相信你可以将它分配给一个 var

def outputs = cfnUpdate(...)

see the link below for further information: https://github.com/jenkinsci/pipeline-aws-plugin/blob/master/README.md有关更多信息,请参阅以下链接: https : //github.com/jenkinsci/pipeline-aws-plugin/blob/master/README.md

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM