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 - CURRENT_TAG_VERSION=$(git describe --tags | cut -f2 -dv) # this is here because typing isn't in testpypi, so pull it from prod instead - python3 -m pip install typing - python3 continuous-delivery/pip-install-with-retry.py -i https://testpypi.python.org/simple --user AWSIoTPythonSDK-V1==$CURRENT_TAG_VERSION - python3 samples/greengrass/basicDiscovery.py -e ${ENDPOINT} -c /tmp/certificate.pem -k /tmp/privatekey.pem -r /tmp/AmazonRootCA1.pem --print_discover_resp_only post_build: commands: - echo Build completed on `date`