Skip to content

Commit

Permalink
chore: CodeBuild build errors when branch is not 'master' (#10868)
Browse files Browse the repository at this point in the history
The problem is that the shell conditional added returns a non-zero exit
code when the branch is not 'master'.

Switch strategies so that the environment variable comparison is
actually done at deploy time and sets a final environment variable.

Corresponding change: https://github.com/aws/cdk-ops/pull/758

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
Niranjan Jayakar authored Oct 15, 2020
1 parent 25897d6 commit 5f164af
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions buildspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ phases:
- /bin/bash ./fetch-dotnet-snk.sh
build:
commands:
# we bump here so that our master version won't be identical to the latest published version during tests.
# otherwise this causes problems with verdaccio mirroring.
- '[ ${GIT_BRANCH} = ${REGRESSION_TESTS_BRANCH} ] && /bin/bash ./bump-candidate.sh'
- 'if ${BUMP_CANDIDATE:-false}; then /bin/bash ./bump-candidate.sh; fi'
- /bin/bash ./scripts/align-version.sh
- /bin/bash ./build.sh
post_build:
Expand Down
2 changes: 1 addition & 1 deletion bump-candidate.sh → scripts/bump-candidate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ version=${1:-minor}

echo "Starting candidate ${version} version bump"

npx standard-version --release-as ${version} --prerelease=rc --skip.commit --skip.changelog
npx standard-version --release-as ${version} --prerelease=rc --skip.commit --skip.changelog

0 comments on commit 5f164af

Please sign in to comment.