Skip to content

Commit cfc3944

Browse files
Justin Boswelljustinboswell
Justin Boswell
authored andcommitted
Fixed up CD pipeline to work from github releases instead of annotated tags
1 parent be9c9a1 commit cfc3944

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

continuous-delivery/test_prod_pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ phases:
1818
commands:
1919
- echo Build started on `date`
2020
- cd aws-iot-device-sdk-python-v2
21-
- CURRENT_TAG_VERSION=$(git describe --abbrev=0)
21+
- CURRENT_TAG_VERSION=$(git describe --tags | cut -f2 -dv)
2222
- python3 -m pip install --user awsiotsdk==$CURRENT_TAG_VERSION
2323
- 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
2424

continuous-delivery/test_test_pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ phases:
1818
commands:
1919
- echo Build started on `date`
2020
- cd aws-iot-device-sdk-python-v2
21-
- CURRENT_TAG_VERSION=$(git describe --abbrev=0)
21+
- CURRENT_TAG_VERSION=$(git describe --tags | cut -f2 -dv)
2222
# this is here because typing isn't in testpypi, so pull it from prod instead
2323
- python3 -m pip install typing
2424
- python3 -m pip install -i https://testpypi.python.org/simple --user awsiotsdk==$CURRENT_TAG_VERSION

continuous-delivery/test_version_exists

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
#!/usr/bin/env bash
22
set -e
3-
#force a failure if there's no tag
4-
git describe --abbrev=0
5-
#now get the tag
6-
CURRENT_TAG_VERSION=$(git describe --abbrev=0)
3+
set -x
4+
# force a failure if there's no tag
5+
git describe --tags
6+
# now get the tag
7+
CURRENT_TAG=$(git describe --tags | cut -f2 -dv)
8+
# convert v0.2.12-2-g50254a9 to 0.2.12
9+
CURRENT_TAG_VERSION=$(git describe --tags | cut -f1 -d'-' | cut -f2 -dv)
10+
# if there's a hash on the tag, then this is not a release tagged commit
11+
if [ "$CURRENT_TAG" != "$CURRENT_TAG_VERSION" ]; then
12+
echo "Current tag version is not a release tag, cut a new release if you want to publish."
13+
exit 1
14+
fi
15+
716
if pip install -vvv awsiotsdk==$CURRENT_TAG_VERSION; then
817
echo "$CURRENT_TAG_VERSION is already in pypi, cut a new tag if you want to upload another version."
918
exit 1

0 commit comments

Comments
 (0)