Is it possible to make the build stage parallel? today the build stage builds and deploys all the images in a sequence, which takes quite a lot of time. it would save a lot of time if each image will be built in parallel to the others (same as the deploy stage).
Asked
Active
Viewed 93 times
1 Answers
0
The deploy stage does run in parallel, unless you opt to deploy them in order with the stages.deployments
field in your pipeline manifest.
As for the build stage, you can make changes to your own pipeline's buildspec, specifically in this block:
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;