Skip to content

Commit b2b6370

Browse files
chore: Release improvements (#167)
1 parent 671c58d commit b2b6370

File tree

5 files changed

+128
-2
lines changed

5 files changed

+128
-2
lines changed

codebuild/release/prod-release.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
version: 0.2
2+
3+
env:
4+
variables:
5+
BRANCH: "master"
6+
secrets-manager:
7+
TWINE_USERNAME: PyPiAdmin:username
8+
TWINE_PASSWORD: PyPiAdmin:password
9+
10+
phases:
11+
install:
12+
commands:
13+
- pip install tox
14+
- pip install --upgrade pip
15+
runtime-versions:
16+
python: latest
17+
pre_build:
18+
commands:
19+
- git checkout $COMMIT_ID
20+
- FOUND_VERSION=$(sed -n 's/__version__ = "\(.*\)"/\1/p' src/dynamodb_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
26+
build:
27+
commands:
28+
- tox -e park
29+
- tox -e release
30+
31+
batch:
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

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
version: 0.2
2+
3+
env:
4+
variables:
5+
BRANCH: "master"
6+
secrets-manager:
7+
TWINE_USERNAME: TestPyPiCryptoTools:username
8+
TWINE_PASSWORD: TestPyPiCryptoTools:password
9+
10+
phases:
11+
install:
12+
commands:
13+
- pip install tox
14+
- pip install --upgrade pip
15+
runtime-versions:
16+
python: latest
17+
pre_build:
18+
commands:
19+
- git checkout $COMMIT_ID
20+
- FOUND_VERSION=$(sed -n 's/__version__ = "\(.*\)"/\1/p' src/dynamodb_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
26+
build:
27+
commands:
28+
- tox -e park
29+
- tox -e test-release
30+
31+
32+
batch:
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

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
version: 0.2
2+
3+
env:
4+
variables:
5+
BRANCH: "master"
6+
AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >-
7+
arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f
8+
DDB_ENCRYPTION_CLIENT_TEST_TABLE_NAME: ddbec-release-validation
9+
10+
11+
phases:
12+
install:
13+
commands:
14+
- pip install tox
15+
runtime-versions:
16+
python: latest
17+
pre_build:
18+
commands:
19+
- cd examples
20+
- sed -i "s/dynamodb-encryption-sdk/dynamodb-encryption-sdk==$VERSION/" test/requirements.txt
21+
build:
22+
commands:
23+
- NUM_RETRIES=3
24+
- |
25+
while [ $NUM_RETRIES -gt 0 ]
26+
do
27+
tox -re py38-examples
28+
if [ $? -eq 0 ]; then
29+
break
30+
fi
31+
NUM_RETRIES=$((NUM_RETRIES-1))
32+
if [ $NUM_RETRIES -eq 0 ]; then
33+
echo "All validation attempts failed, stopping"
34+
exit 1;
35+
else
36+
echo "Validation failed, retrying in 60 seconds; will retry $NUM_RETRIES more times" && sleep 60
37+
fi
38+
done
39+

examples/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def get_requirements():
3636
author_email="[email protected]",
3737
maintainer="Amazon Web Services",
3838
description="DynamoDB Encryption Client for Python examples",
39-
long_description=read("README.rst"),
39+
long_description=read("README.md"),
4040
keywords="dynamodb-encryption-sdk aws kms encryption dynamodb",
4141
data_files=["requirements.txt"],
4242
license="Apache License 2.0",

examples/tox.ini

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ passenv =
1616
# Pass through AWS credentials
1717
AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN \
1818
# AWS Role access in CodeBuild is via the container URI
19-
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
19+
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI \
20+
# Pass through the default AWS region
21+
AWS_DEFAULT_REGION
22+
2023
sitepackages = False
2124
deps = -rtest/requirements.txt
2225
# 'download' forces tox to always upgrade pip to the latest

0 commit comments

Comments
 (0)