Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes use of target spec_filename over default for CodeBuild deployme…
…nts (#174) **Issue:** When using CodeBuild for both deployment steps and integration tests, you would want to be able to specify the use of a specific `spec_filename` as shown in the third target stage below (named `integration-tests`). ```yaml pipelines: - name: deploy-using-codebuild-pipeline default_providers: source: provider: codecommit properties: account_id: 111111111111 build: provider: codebuild properties: image: STANDARD_2_0 deploy: provider: codebuild properties: image: STANDARD_2_0 spec_filename: different_deployspec.yml targets: - name: deploy-to-dev provider: codebuild properties: environment_variables: BUCKET_NAME: some-bucket-to-use-in-dev - name: deploy-to-test provider: codebuild properties: environment_variables: BUCKET_NAME: some-bucket-to-use-in-test - name: integration-tests provider: codebuild properties: spec_filename: testspec.yml - approval - name: deploy-to-prod provider: codebuild properties: environment_variables: BUCKET_NAME: some-bucket-to-use-in-prod ``` Instead of using the specific one, it uses the one specified in the default providers. So is uses: `different_deployspec.yml` for all targets that have `codebuild` as its provider. Whereas the third step (named `integration-tests`) should have used `testspec.yml` instead. **Fix:** The root cause of the issue is an incorrect ordering in the evaluation of which `spec_filename` to use. Changed the order to use the target `spec_filename` if specified, otherwise it will try to use the one specified in the default providers list followed by the generic `deployspec.yml`.
- Loading branch information