Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Ensure that the intended version is deployed (close snowplow#739)
Browse files Browse the repository at this point in the history
  • Loading branch information
colmsnowplow committed Aug 27, 2019
1 parent 0c64a30 commit a2ac6c6
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ deploy:
skip_cleanup: true
script: ./.travis/deploy.py
on:
condition: '"$(.travis/is_core_release_tag.sh $TRAVIS_TAG)" == "" && $? == 0'
condition: '"$(.travis/is_correct_core_release_tag.sh $TRAVIS_TAG)" == "" && $? == 0'
tags: true
# - provider: script
# skip_cleanup: true
Expand All @@ -47,7 +47,7 @@ deploy:
secure: juUw//XdoRAb494NvxNTghZC7TBJLBx8WdAZsrSGp+6Sf7yPZ6skDt/+qU2VgrG/4RBWUwl3lnAWobiY6ZQQSD95lQDyVM9IdC9JHchhVav1nHBrcJWubEKN/R0Ri/3XjLFJ/LFlkdOteYYPVZR6MGehRR9Gsnazavk9+0x6c1A=
file: $TRAVIS_BUILD_DIR/dist/sp.js
on:
condition: '"$(.travis/is_tracker_release_tag.sh $TRAVIS_TAG)" == "" && $? == 0'
condition: '"$(.travis/is_correct_tracker_release_tag.sh $TRAVIS_TAG)" == "" && $? == 0'
tags: true
env:
global:
Expand Down
19 changes: 19 additions & 0 deletions .travis/is_correct_core_release_tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

tag=$1
cicd=${tag:0:4}
release=${tag:5}
coreVersion=$(node -e 'const {version} = require("./core/package.json"); console.log(`${version}`);')

if [ "${cicd}" == "core" ]; then
if [ "${release}" == "" ]; then
echo "Warning! No release specified! Ignoring."
exit 2
elif [ "${release}" != "${coreVersion}" ]; then
echo "Tagged version ${release} does not equal core package version ${coreVersion}"
exit 1
fi
exit 0
else
exit 1
fi
17 changes: 17 additions & 0 deletions .travis/is_correct_tracker_release_tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

tag=$1
release=$tag
trackerVersion=$(node -e 'const {version} = require("./package.json"); console.log(`${version}`);')

if [ "${release}" == "" ]; then
echo "Warning! No release specified! Ignoring."
exit 2
else
if [ "${release:0:4}" == "core" ]; then
echo "Core relase, not tracker"
elif [ "${release}" != "${trackerVersion}" ]; then
echo "Tagged version ${release} does not equal tracker package version ${trackerVersion}"
fi
fi
exit 0

0 comments on commit a2ac6c6

Please sign in to comment.