Skip to content

Commit 0544be5

Browse files
farleyb-amazonrobin-aws
authored andcommitted
chore: Add validation to test release codebuild spec (aws#326)
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 646e32e commit 0544be5

File tree

3 files changed

+61
-15
lines changed

3 files changed

+61
-15
lines changed

codebuild/release/prod-release.yml

+22-10
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
17+
pre_build:
18+
commands:
19+
- git checkout $COMMIT_ID
20+
- FOUND_VERSION=$(sed -n 's/__version__ = "\(.*\)"/\1/p' src/aws_encryption_sdk/identifiers.py)
21+
- |
22+
if expr ${FOUND_VERSION} != ${VERSION}; then
23+
echo "identifiers.py version (${FOUND_VERSION}) does not match expected version (${VERSION}), stopping"
24+
exit 1;
25+
fi
1426
build:
1527
commands:
16-
- pip install tox
17-
- git checkout $BRANCH
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:
29-
- identifier: prod_release
32+
fast-fail: true
33+
build-graph:
34+
- identifier: release_to_prod
35+
- identifier: validate_prod_release
36+
depend-on:
37+
- release_to_prod
38+
buildspec: codebuild/release/validate.yml
39+
env:
40+
variables:
41+
PIP_INDEX_URL: https://pypi.python.org/simple/

codebuild/release/test-release.yml

+23-5
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
17+
pre_build:
18+
commands:
19+
- git checkout $COMMIT_ID
20+
- FOUND_VERSION=$(sed -n 's/__version__ = "\(.*\)"/\1/p' src/aws_encryption_sdk/identifiers.py)
21+
- |
22+
if expr ${FOUND_VERSION} != ${VERSION}; then
23+
echo "identifiers.py version (${FOUND_VERSION}) does not match expected version (${VERSION}), stopping"
24+
exit 1;
25+
fi
1426
build:
1527
commands:
16-
- pip install tox
17-
- git checkout $BRANCH
1828
- tox -e park
1929
- tox -e test-release
2030

2131

2232
batch:
23-
fast-fail: false
24-
build-list:
25-
- identifier: test_release
33+
fast-fail: true
34+
build-graph:
35+
- identifier: release_to_staging
36+
- identifier: validate_staging_release
37+
depend-on:
38+
- release_to_staging
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)