Skip to content

Commit ce1ecb0

Browse files
robin-awstexastony
authored andcommitted
chore: Release using codebuild (#206)
Applying the same structure as we already have in the https://github.com/aws/aws-encrytion-sdk-python repo. (cherry picked from commit 11d4c9d)
1 parent 4a8144a commit ce1ecb0

File tree

6 files changed

+118
-3
lines changed

6 files changed

+118
-3
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
aws-encryption-sdk-cli==1.9.0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
aws-encryption-sdk-cli==2.2.0

api_compatibility_tests/tox.ini

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
11
[tox]
22
envlist =
3-
# Only include released versions by default
4-
py38-awses_cli_{1.7.0,2.0.0}
3+
py38-awses_cli_{1.7.0,1.8.0,1.9.0,2.0.0,2.1.0,2.2.0}
54

65
[testenv:base-command]
76
commands = pytest --basetemp={envtmpdir} -l test/ {posargs}
87

98
[testenv]
109
passenv =
11-
AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID
10+
# Identifies AWS KMS key id to use in integration tests
11+
AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID \
12+
# Pass through AWS credentials
13+
AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN \
14+
# AWS Role access in CodeBuild is via the contaner URI
15+
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI \
16+
# Pass through AWS profile name (useful for local testing)
17+
AWS_PROFILE \
18+
# Pass through custom pip config file settings
19+
PIP_CONFIG_FILE
1220
sitepackages = False
1321
deps =
1422
-rtest/requirements.txt
1523
awses_cli_1.7.0: -rcompatibility-requirements/1.7.0
1624
awses_cli_1.8.0: -rcompatibility-requirements/1.8.0
25+
awses_cli_1.9.0: -rcompatibility-requirements/1.9.0
1726
awses_cli_2.0.0: -rcompatibility-requirements/2.0.0
1827
awses_cli_2.1.0: -rcompatibility-requirements/2.1.0
28+
awses_cli_2.2.0: -rcompatibility-requirements/2.2.0
1929
awses_cli_local: -e {env:AWSES_CLI_LOCAL_PATH}
2030
commands =
2131
{[testenv:base-command]commands}

codebuild/release/prod-release.yml

Lines changed: 41 additions & 0 deletions
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/aws_encryption_sdk_cli/internal/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

Lines changed: 43 additions & 0 deletions
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/aws_encryption_sdk_cli/internal/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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 0.2
2+
3+
env:
4+
variables:
5+
AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >-
6+
arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f
7+
8+
phases:
9+
install:
10+
commands:
11+
- pip install tox
12+
runtime-versions:
13+
python: latest
14+
pre_build:
15+
commands:
16+
- cd api_compatibility_tests
17+
build:
18+
commands:
19+
- tox -e py38-awses_cli_${VERSION}

0 commit comments

Comments
 (0)