Skip to content

Commit 5021ea4

Browse files
Validate the source code has the expected version
1 parent 4cc26d7 commit 5021ea4

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

codebuild/release/prod-release.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ phases:
1616
python: latest
1717
pre_build:
1818
commands:
19-
- git checkout $BRANCH
20-
- CURRENT_COMMIT=$(git rev-parse --short HEAD)
19+
- git checkout $COMMIT_ID
20+
- FOUND_VERSION=$(sed -n 's/__version__ = "\(.*\)"/\1/p' src/aws_encryption_sdk/identifiers.py)
2121
- |
22-
if expr "${CURRENT_COMMIT}" != ${COMMIT_ID}; then
23-
echo "HEAD of repository commit (${CURRENT_COMMIT}) did not match expected commit (${COMMIT_ID}), stopping"
22+
if expr ${FOUND_VERSION} != ${VERSION}; then
23+
echo "identifiers.py does not contain expected version string ${VERSION}, stopping"
2424
exit 1;
2525
fi
2626
build:

codebuild/release/test-release.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ phases:
1616
python: latest
1717
pre_build:
1818
commands:
19-
- git checkout $BRANCH
20-
- CURRENT_COMMIT=$(git rev-parse --short HEAD)
19+
- git checkout $COMMIT_ID
20+
- FOUND_VERSION=$(sed -n 's/__version__ = "\(.*\)"/\1/p' src/aws_encryption_sdk/identifiers.py)
2121
- |
22-
if expr "${CURRENT_COMMIT}" != ${COMMIT_ID}; then
23-
echo "HEAD of repository commit (${CURRENT_COMMIT}) did not match expected commit (${COMMIT_ID}), stopping"
22+
if expr ${FOUND_VERSION} != ${VERSION}; then
23+
echo "identifiers.py does not contain expected version string ${VERSION}, stopping"
2424
exit 1;
2525
fi
2626
build:

0 commit comments

Comments
 (0)