1 個回答
- 最新
- 最多得票
- 最多評論
1
Hello,
To create 3 different artifacts/packages for the respective environments, the chalice package command would have to be run 3 times. This can be done in the same build by adding the various commands and then outputting the artifacts as secondary artifacts. Also, the commands can also be run separately in a pipeline using 3 different build stages. See an example of outputting multiple artifacts here.
已回答 2 年前
Thank you. I now ended up using resource files in Chalice, i.e.:
- chalice package --merge-template dev.json /tmp/dev - chalice package --merge-template qa.json /tmp/qa - chalice package --merge-template prod.json /tmp/prod - aws cloudformation package --template-file /tmp/dev/sam.json --s3-bucket ${APP_S3_BUCKET} --output-template-file devtransformed.yaml - aws cloudformation package --template-file /tmp/qa/sam.json --s3-bucket ${APP_S3_BUCKET} --output-template-file qatransformed.yaml - aws cloudformation package --template-file /tmp/prod/sam.json --s3-bucket ${APP_S3_BUCKET} --output-template-file prodtransformed.yaml
with:
artifacts: files: - "*.yaml" secondary-artifacts: devartifacts: # base-directory: $CODEBUILD_SRC_DIR files: - devtransformed.yaml qaartifacts: # base-directory: $CODEBUILD_SRC_DIR files: - qatransformed.yaml prodartifacts: # base-directory: $CODEBUILD_SRC_DIR files: - prodtransformed.yaml
then update the codecommit pipeline to use those 3 artifacts.
相關內容
- AWS 官方已更新 2 年前
- AWS 官方已更新 3 年前
chalice package is creating the final package, so yes you will have to run it 3 times. to create different packages for different environments. You can do that in single build or 3 different builds.