From 58d35c7171d3b419facdf6fe15ce5ca74bedc053 Mon Sep 17 00:00:00 2001 From: Justin Boswell Date: Wed, 19 Jun 2019 12:49:10 -0700 Subject: [PATCH] =?UTF-8?q?Switched=20deployment=20scripts=20to=20use=20re?= =?UTF-8?q?lease=20format=20tags=20instead=20of=E2=80=A6=20(#54)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Switched deployment scripts to use any release format tags instead of annotated tags on master * Added aws-c-compression to manifest * Disable caching on pip installs --- MANIFEST.in | 1 + codebuild/cd/test_prod_pypi.yml | 2 +- codebuild/cd/test_test_pypi.yml | 2 +- continuous-delivery/sanity-check-test-pypi.bat | 7 ++++--- continuous-delivery/sanity-check-test-pypi.sh | 8 ++++---- continuous-delivery/test-version-exists | 18 +++++++++++++----- setup.py | 2 +- 7 files changed, 25 insertions(+), 15 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index d790a3d52..cdd50a6e8 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,7 @@ graft source graft aws-c-common graft aws-c-io +graft aws-c-compression graft s2n graft aws-c-mqtt graft aws-c-cal diff --git a/codebuild/cd/test_prod_pypi.yml b/codebuild/cd/test_prod_pypi.yml index f4bbddf32..a40e44860 100644 --- a/codebuild/cd/test_prod_pypi.yml +++ b/codebuild/cd/test_prod_pypi.yml @@ -13,7 +13,7 @@ phases: commands: - echo Build started on `date` - cd aws-crt-python - - CURRENT_TAG_VERSION=$(git describe --abbrev=0) + - CURRENT_TAG_VERSION=$(git describe --tags | cut -f2 -dv) - python3 -m pip install --user awscrt==$CURRENT_TAG_VERSION - python3 continuous-delivery/test-pip-install.py post_build: diff --git a/codebuild/cd/test_test_pypi.yml b/codebuild/cd/test_test_pypi.yml index f9da05feb..3f8be168c 100644 --- a/codebuild/cd/test_test_pypi.yml +++ b/codebuild/cd/test_test_pypi.yml @@ -13,7 +13,7 @@ phases: commands: - echo Build started on `date` - cd aws-crt-python - - CURRENT_TAG_VERSION=$(git describe --abbrev=0) + - CURRENT_TAG_VERSION=$(git describe --tags | cut -f2 -dv) - python3 -m pip install -i https://testpypi.python.org/simple --user awscrt==$CURRENT_TAG_VERSION - python3 continuous-delivery/test-pip-install.py post_build: diff --git a/continuous-delivery/sanity-check-test-pypi.bat b/continuous-delivery/sanity-check-test-pypi.bat index 3c1a2f846..c6e6b35e6 100644 --- a/continuous-delivery/sanity-check-test-pypi.bat +++ b/continuous-delivery/sanity-check-test-pypi.bat @@ -1,9 +1,10 @@ -FOR /F "delims=" %%A in ('git describe --abbrev^=0') do ( set CURRENT_VERSION=%%A ) +FOR /F "delims=" %%A in ('git describe --tags') do ( set TAG_VERSION=%%A ) +set CURRENT_VERSION=%TAG_VERSION:v=% -"C:\Program Files\Python37\python.exe" -m pip install -i https://testpypi.python.org/simple --user awscrt==%CURRENT_VERSION% || goto error +"C:\Program Files\Python37\python.exe" -m pip install --no-cache-dir -i https://testpypi.python.org/simple --user awscrt==%CURRENT_VERSION% || goto error "C:\Program Files\Python37\python.exe" continuous-delivery\test-pip-install.py || goto error -"C:\Python27\python.exe" -m pip install -i https://testpypi.python.org/simple --user awscrt==%CURRENT_VERSION% || goto error +"C:\Python27\python.exe" -m pip install --no-cache-dir -i https://testpypi.python.org/simple --user awscrt==%CURRENT_VERSION% || goto error "C:\Python27\python.exe" continuous-delivery\test-pip-install.py || goto error goto :EOF diff --git a/continuous-delivery/sanity-check-test-pypi.sh b/continuous-delivery/sanity-check-test-pypi.sh index d64c69bd0..29aa50d51 100644 --- a/continuous-delivery/sanity-check-test-pypi.sh +++ b/continuous-delivery/sanity-check-test-pypi.sh @@ -1,9 +1,9 @@ #!/bin/bash -set -e -CURRENT_TAG_VERSION=$(git describe --abbrev=0) -python3 -m pip install -i https://testpypi.python.org/simple --user awscrt==$CURRENT_TAG_VERSION +set -ex +CURRENT_TAG_VERSION=$(git describe --tags | cut -f2 -dv) +python3 -m pip install --no-cache-dir -i https://testpypi.python.org/simple --user awscrt==$CURRENT_TAG_VERSION python3 continuous-delivery/test-pip-install.py -python -m pip install -i https://testpypi.python.org/simple --user awscrt==$CURRENT_TAG_VERSION +python -m pip install --no-cache-dir -i https://testpypi.python.org/simple --user awscrt==$CURRENT_TAG_VERSION python continuous-delivery/test-pip-install.py diff --git a/continuous-delivery/test-version-exists b/continuous-delivery/test-version-exists index 2deb246cc..f9145aef8 100755 --- a/continuous-delivery/test-version-exists +++ b/continuous-delivery/test-version-exists @@ -1,10 +1,18 @@ #!/usr/bin/env bash -set -e +set -ex #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 awscrt==$CURRENT_TAG_VERSION; then +git describe --tags +# now get the tag +CURRENT_TAG=$(git describe --tags | cut -f2 -dv) +# convert v0.2.12-2-g50254a9 to 0.2.12 +CURRENT_TAG_VERSION=$(git describe --tags | cut -f1 -d'-' | cut -f2 -dv) +# if there's a hash on the tag, then this is not a release tagged commit +if [ "$CURRENT_TAG" != "$CURRENT_TAG_VERSION" ]; then + echo "Current tag version is not a release tag, cut a new release if you want to publish." + exit 1 +fi + +if pip install --no-cache-dir -vvv awscrt==$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 diff --git a/setup.py b/setup.py index 6fa26ca0f..6e38935f5 100644 --- a/setup.py +++ b/setup.py @@ -216,7 +216,7 @@ def get_from_env(key): setuptools.setup( name="awscrt", - version="v0.2.18", + version="v0.2.22", author="Amazon Web Services, Inc", author_email="aws-sdk-common-runtime@amazon.com", description="A common runtime for AWS Python projects",