【问题标题】:Is it possible to make the build stage parallel?是否可以使构建阶段并行?
【发布时间】:2022-07-16 00:30:46
【问题描述】:

是否可以使构建阶段并行? 今天,构建阶段按顺序构建和部署所有映像,这需要相当多的时间。如果每个镜像都与其他镜像并行构建(与部署阶段相同),将会节省大量时间。

【问题讨论】:

    标签: aws-copilot


    【解决方案1】:

    抱歉回复延迟;我们之前不知何故错过了您的问题。

    部署阶段确实并行运行,除非您选择使用管道清单中的 stages.deployments 字段按顺序部署它们。

    至于构建阶段,感谢您提出的好建议——我们正在考虑实施此更改;同时,您可以更改自己管道的构建规范,特别是在此块中:

    for env in $pl_envs; do
      tag=$(sed 's/:/-/g' <<<"${CODEBUILD_BUILD_ID##*:}-${env}" | rev | cut -c 1-128 | rev)
      for svc in $svcs; do
      ./copilot-linux svc package -n $svc -e $env --output-dir './infrastructure' --tag $tag --upload-assets;
      if [ $? -ne 0 ]; then
        echo "Cloudformation stack and config files were not generated. Please check build logs to see if there was a manifest validation error." 1>&2;
        exit 1;
      fi
      done;
      for job in $jobs; do
      ./copilot-linux job package -n $job -e $env --output-dir './infrastructure' --tag $tag --upload-assets;
      if [ $? -ne 0 ]; then
      echo "Cloudformation stack and config files were not generated. Please check build logs to see if there was a manifest validation error." 1>&2;
      exit 1;
      fi
      done;
    done;
    

    【讨论】:

      猜你喜欢
      • 2020-09-08
      • 2019-03-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-26
      • 2020-03-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多