【问题标题】:How do I handle errors when deploying aws ecs via the Jenkins pipeline?通过 Jenkins 管道部署 aws ecs 时如何处理错误?
【发布时间】:2020-01-09 21:06:47
【问题描述】:

通过 Jenkins 管道部署 aws ecs 时 注册工作定义时,环境变量中没有设置结果,为什么会报错?

jenkins error image

jenkinsfile code image

stage('Aws ECS Deploy') {
            environment {
                TASK_ECS = sh '$(aws ecs register-task-definition --cli-input-json file://api-server/definition.json | jq --raw-output .taskDefinition.revision)'
            }
            steps {
                sh 'aws ecs update-service --cluster default --service api --task-definition api-server:$TASK_ECS'
            }
}

【问题讨论】:

    标签: jenkins amazon-ecs


    【解决方案1】:

    您需要确保运行管道作业的代理具有这些命令 (aws ecs register-task-definition) 可用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-12-13
      • 2020-09-20
      • 2017-09-30
      • 2019-07-28
      • 1970-01-01
      • 1970-01-01
      • 2017-10-04
      • 1970-01-01
      相关资源
      最近更新 更多