Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions continuous-delivery/publish_to_prod_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 0.2
# this image assumes Ubuntu 14.04 base image
phases:
install:
commands:
- sudo apt-get update -y
- sudo apt-get install python3 python3-pip -y
- python3 -m pip install --user --upgrade pip
- python3 -m pip install --user --upgrade twine setuptools wheel boto3 PyOpenSSL six
pre_build:
commands:
- pypirc=$(aws secretsmanager get-secret-value --secret-id "prod/aws-crt-python/.pypirc" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") && echo "$pypirc" > ~/.pypirc
build:
commands:
- echo Build started on `date`
- cd aws-iot-device-sdk-python-v2
- python3 setup.py sdist bdist_wheel --universal
- python3 -m twine upload -r pypi dist/*
post_build:
commands:
- echo Build completed on `date`

22 changes: 22 additions & 0 deletions continuous-delivery/publish_to_test_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 0.2
# this image assumes Ubuntu 14.04 base image
phases:
install:
commands:
- sudo apt-get update -y
- sudo apt-get install python3 python3-pip -y
- python3 -m pip install --user --upgrade pip
- python3 -m pip install --user --upgrade twine setuptools wheel boto3 PyOpenSSL six
pre_build:
commands:
- pypirc=$(aws secretsmanager get-secret-value --secret-id "alpha/aws-crt-python/.pypirc" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") && echo "$pypirc" > ~/.pypirc
build:
commands:
- echo Build started on `date`
- cd aws-iot-device-sdk-python-v2
- python3 setup.py sdist bdist_wheel --universal
- python3 -m twine upload -r testpypi dist/*
post_build:
commands:
- echo Build completed on `date`

28 changes: 28 additions & 0 deletions continuous-delivery/test_prod_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: 0.2
# this image assumes Ubuntu 14.04 base image
phases:
install:
commands:
- sudo apt-get update -y
- sudo apt-get install python3 python3-pip -y
- python3 -m pip install --upgrade pip
- python3 -m pip install --upgrade setuptools

pre_build:
commands:
- curl https://www.amazontrust.com/repository/AmazonRootCA1.pem --output /tmp/AmazonRootCA1.pem
- cert=$(aws secretsmanager get-secret-value --secret-id "unit-test/certificate" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") && echo "$cert" > /tmp/certificate.pem
- key=$(aws secretsmanager get-secret-value --secret-id "unit-test/privatekey" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") && echo "$key" > /tmp/privatekey.pem
- ENDPOINT=$(aws secretsmanager get-secret-value --secret-id "unit-test/endpoint" --query "SecretString" | cut -f2 -d":" | sed -e 's/[\\\"\}]//g')
build:
commands:
- echo Build started on `date`
- cd aws-iot-device-sdk-python-v2
- CURRENT_TAG_VERSION=$(git describe --abbrev=0)
- python3 -m pip install --user awsiot==$CURRENT_TAG_VERSION
- python3 samples/basic_discovery.py --region us-east-1 --cert /tmp/certificate.pem --key /tmp/privatekey.pem --ca_file /tmp/AmazonRootCA1.pem --thing_name aws-sdk-crt-unit-test --print_discover_resp_only -v Trace

post_build:
commands:
- echo Build completed on `date`

28 changes: 28 additions & 0 deletions continuous-delivery/test_test_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: 0.2
# this image assumes Ubuntu 14.04 base image
phases:
install:
commands:
- sudo apt-get update -y
- sudo apt-get install python3 python3-pip -y
- python3 -m pip install --upgrade pip
- python3 -m pip install --upgrade setuptools

pre_build:
commands:
- curl https://www.amazontrust.com/repository/AmazonRootCA1.pem --output /tmp/AmazonRootCA1.pem
- cert=$(aws secretsmanager get-secret-value --secret-id "unit-test/certificate" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") && echo "$cert" > /tmp/certificate.pem
- key=$(aws secretsmanager get-secret-value --secret-id "unit-test/privatekey" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") && echo "$key" > /tmp/privatekey.pem
- ENDPOINT=$(aws secretsmanager get-secret-value --secret-id "unit-test/endpoint" --query "SecretString" | cut -f2 -d":" | sed -e 's/[\\\"\}]//g')
build:
commands:
- echo Build started on `date`
- cd aws-iot-device-sdk-python-v2
- CURRENT_TAG_VERSION=$(git describe --abbrev=0)
- python3 -m pip install -i https://testpypi.python.org/simple --user awsiot==$CURRENT_TAG_VERSION
- python3 samples/basic_discovery.py --region us-east-1 --cert /tmp/certificate.pem --key /tmp/privatekey.pem --ca_file /tmp/AmazonRootCA1.pem --thing_name aws-sdk-crt-unit-test --print_discover_resp_only -v Trace

post_build:
commands:
- echo Build completed on `date`

13 changes: 13 additions & 0 deletions continuous-delivery/test_version_exists
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -e
#force a failure if there's no tag
git describe --abbrev=0
#now get the tag
CURRENT_TAG_VERSION=$(git describe --abbrev=0)
if pip install -vvv awsiot==$CURRENT_TAG_VERSION; then
echo "$CURRENT_TAG_VERSION is already in pypi, cut a new tag if you want to upload another version."
exit 1
fi

echo "$CURRENT_TAG_VERSION currently does not exist in pypi, allowing pipeline to continue."
exit 0
21 changes: 21 additions & 0 deletions continuous-delivery/test_version_exists.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 0.2
#this build spec assumes the ubuntu 14.04 trusty image
#this build run simply verifies we haven't published something at this tag yet.
#if we have we fail the build and stop the pipeline, if we haven't we allow the pipeline to run.
phases:
install:
commands:
- sudo apt-get update -y
- sudo apt-get install python3 python3-pip -y
- pip3 install --upgrade setuptools
pre_build:
commands:
build:
commands:
- echo Build started on `date`
- cd aws-iot-device-sdk-python-v2
- bash ./continuous-delivery/test_version_exists
post_build:
commands:
- echo Build completed on `date`

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

setup(
name='awsiot',
version='2.2',
version='0.2.2',
description='AWS IoT SDK based on the AWS Common Runtime',
author='AWS SDK Common Runtime Team',
url='https://github.com/awslabs/aws-iot-device-sdk-python-v2',
Expand Down