Skip to content

Commit 74f7f32

Browse files
authored
chore: Add AWS CodeBuild buildspec (#146)
Adding buildspec to batch build multiple Python runtimes * Python 2.7 * Python 3.5 * Python 3.6 * Python 3.7 * Python 3.8
1 parent d610e0b commit 74f7f32

File tree

7 files changed

+135
-0
lines changed

7 files changed

+135
-0
lines changed

buildspec.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 0.2
2+
3+
batch:
4+
fast-fail: false
5+
build-list:
6+
- identifier: python2_7
7+
buildspec: codebuild/python2.7.yml
8+
- identifier: python3_5
9+
buildspec: codebuild/python3.5.yml
10+
- identifier: python3_6
11+
buildspec: codebuild/python3.6.yml
12+
- identifier: python3_7
13+
buildspec: codebuild/python3.7.yml
14+
- identifier: python3_8
15+
buildspec: codebuild/python3.8.yml

codebuild/python2.7.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 0.2
2+
3+
env:
4+
variables:
5+
TOXENV: "py27-integ-slow"
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+
AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >-
9+
arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2
10+
11+
phases:
12+
install:
13+
runtime-versions:
14+
python: latest
15+
build:
16+
commands:
17+
- pip install tox
18+
- tox

codebuild/python3.5.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
version: 0.2
2+
3+
env:
4+
variables:
5+
TOXENV: "py35-integ-slow"
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+
AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >-
9+
arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2
10+
11+
phases:
12+
install:
13+
runtime-versions:
14+
python: latest
15+
build:
16+
commands:
17+
# The specific versions are manually installed
18+
# because they are not installed
19+
# by default in CodeBuild containers.
20+
# `pyenv` does not have
21+
# a nice way to just install
22+
# the latest patch version.
23+
# I have selected the current latest patch
24+
# rather than try
25+
# and manage a one-liner or script.
26+
# Testing every minor version
27+
# is too extreme at this time.
28+
# The choice of versions should be reviewed.
29+
- pyenv install 3.5.9
30+
- pyenv local 3.5.9
31+
- pip install tox tox-pyenv
32+
- tox

codebuild/python3.6.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 0.2
2+
3+
env:
4+
variables:
5+
TOXENV: "py36-integ-slow"
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+
AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >-
9+
arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2
10+
11+
phases:
12+
install:
13+
runtime-versions:
14+
python: latest
15+
build:
16+
commands:
17+
- pip install tox
18+
- tox

codebuild/python3.7.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
version: 0.2
2+
3+
env:
4+
variables:
5+
TOXENV: "py37-integ-slow"
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+
AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >-
9+
arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2
10+
11+
phases:
12+
install:
13+
runtime-versions:
14+
python: latest
15+
build:
16+
commands:
17+
# The specific versions are manually installed
18+
# because they are not installed
19+
# by default in CodeBuild containers.
20+
# `pyenv` does not have
21+
# a nice way to just install
22+
# the latest patch version.
23+
# I have selected the current latest patch
24+
# rather than try
25+
# and manage a one-liner or script.
26+
# Testing every minor version
27+
# is too extreme at this time.
28+
# The choice of versions should be reviewed.
29+
- pyenv install 3.7.9
30+
- pyenv local 3.7.9
31+
- pip install tox tox-pyenv
32+
- tox

codebuild/python3.8.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 0.2
2+
3+
env:
4+
variables:
5+
TOXENV: "py38-integ-slow"
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+
AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >-
9+
arn:aws:kms:eu-central-1:658956600833:key/75414c93-5285-4b57-99c9-30c1cf0a22c2
10+
11+
phases:
12+
install:
13+
runtime-versions:
14+
python: latest
15+
build:
16+
commands:
17+
- pip install tox
18+
- tox

tox.ini

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ passenv =
4646
DDB_ENCRYPTION_CLIENT_TEST_TABLE_NAME \
4747
# Pass through AWS credentials
4848
AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN \
49+
# AWS Role access in CodeBuild is via the contaner URI
50+
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI \
4951
# Pass through AWS profile name (useful for local testing)
5052
AWS_PROFILE \
5153
# Pass through the default AWS region (used for integration tests)

0 commit comments

Comments
 (0)