Skip to content

Commit 4cc26d7

Browse files
chore: Add validation to test release codebuild spec
Now the test release validation does the same checks as the prod release (running the sample application against the new version). To support this I've also refactored out the validation steps into a dedicated spec so both the prod and test specs can depend on it.
1 parent 93e4648 commit 4cc26d7

File tree

3 files changed

+59
-13
lines changed

3 files changed

+59
-13
lines changed

codebuild/release/prod-release.yml

+21-9
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,33 @@ env:
99

1010
phases:
1111
install:
12+
commands:
13+
- pip install tox
14+
- pip install --upgrade pip
1215
runtime-versions:
1316
python: latest
14-
build:
17+
pre_build:
1518
commands:
16-
- pip install tox
1719
- git checkout $BRANCH
20+
- CURRENT_COMMIT=$(git rev-parse --short HEAD)
21+
- |
22+
if expr "${CURRENT_COMMIT}" != ${COMMIT_ID}; then
23+
echo "HEAD of repository commit (${CURRENT_COMMIT}) did not match expected commit (${COMMIT_ID}), stopping"
24+
exit 1;
25+
fi
26+
build:
27+
commands:
1828
- tox -e park
1929
- tox -e release
20-
- git clone https://github.com/aws-samples/busy-engineers-document-bucket.git
21-
- cd busy-engineers-document-bucket/exercises/python/encryption-context-complete
22-
- sed -i "s/aws_encryption_sdk/aws_encryption_sdk==$VERSION/" requirements-dev.txt
23-
- tox -e test
24-
2530

2631
batch:
27-
fast-fail: false
28-
build-list:
32+
fast-fail: true
33+
build-graph:
2934
- identifier: prod_release
35+
- identifier: validate_release
36+
depend-on:
37+
- prod_release
38+
buildspec: codebuild/release/validate.yml
39+
env:
40+
variables:
41+
PIP_INDEX_URL: https://pypi.python.org/simple/

codebuild/release/test-release.yml

+22-4
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,35 @@ env:
99

1010
phases:
1111
install:
12+
commands:
13+
- pip install tox
14+
- pip install --upgrade pip
1215
runtime-versions:
1316
python: latest
14-
build:
17+
pre_build:
1518
commands:
16-
- pip install tox
1719
- git checkout $BRANCH
20+
- CURRENT_COMMIT=$(git rev-parse --short HEAD)
21+
- |
22+
if expr "${CURRENT_COMMIT}" != ${COMMIT_ID}; then
23+
echo "HEAD of repository commit (${CURRENT_COMMIT}) did not match expected commit (${COMMIT_ID}), stopping"
24+
exit 1;
25+
fi
26+
build:
27+
commands:
1828
- tox -e park
1929
- tox -e test-release
2030

2131

2232
batch:
23-
fast-fail: false
24-
build-list:
33+
fast-fail: true
34+
build-graph:
2535
- identifier: test_release
36+
- identifier: validate_test_release
37+
depend-on:
38+
- test_release
39+
buildspec: codebuild/release/validate.yml
40+
env:
41+
variables:
42+
PIP_INDEX_URL: https://test.pypi.org/simple/
43+
PIP_EXTRA_INDEX_URL: https://pypi.python.org/simple/

codebuild/release/validate.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 0.2
2+
3+
phases:
4+
install:
5+
commands:
6+
- pip install tox
7+
runtime-versions:
8+
python: latest
9+
pre_build:
10+
commands:
11+
- git clone https://github.com/aws-samples/busy-engineers-document-bucket.git
12+
- cd busy-engineers-document-bucket/exercises/python/encryption-context-complete
13+
- sed -i "s/aws_encryption_sdk/aws_encryption_sdk==$VERSION/" requirements-dev.txt
14+
build:
15+
commands:
16+
- tox -e test

0 commit comments

Comments
 (0)