summaryrefslogtreecommitdiff
path: root/contrib/cirrus/upload_release_archive.sh
diff options
context:
space:
mode:
authorChris Evich <cevich@redhat.com>2019-10-22 12:31:30 -0400
committerChris Evich <cevich@redhat.com>2019-10-29 10:34:58 -0400
commit8303eb30377a41879c982b62b53cc549c60b74c0 (patch)
tree4b7242de8dba16a0406552ebee90135ec95e322e /contrib/cirrus/upload_release_archive.sh
parenta56131fef4a82824b397c94f6b7edcdb24769624 (diff)
downloadpodman-8303eb30377a41879c982b62b53cc549c60b74c0.tar.gz
podman-8303eb30377a41879c982b62b53cc549c60b74c0.tar.bz2
podman-8303eb30377a41879c982b62b53cc549c60b74c0.zip
Cirrus: Only upload tagged releases
Prior to this commit, every push to master had it's builds packaged and uploaded to google storage. This is a waste, since potential users are only ever concerned about tagged releases. Unfortunately because the release process involves humans with potentially multiple human and automation steps happening in parallel, it's easy for automation to not detect a tagged release, or trigger on development|pre-release tags. Fix this in `upload_release_archive.sh` using a new unit-tested function `is_release()`. This acts as the definitive authority on whether or not a specific commit rage or `$CIRRUS_TAG` value constitutes something worthy of upload. Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'contrib/cirrus/upload_release_archive.sh')
-rwxr-xr-xcontrib/cirrus/upload_release_archive.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/contrib/cirrus/upload_release_archive.sh b/contrib/cirrus/upload_release_archive.sh
index 25107f0ef..eb7742375 100755
--- a/contrib/cirrus/upload_release_archive.sh
+++ b/contrib/cirrus/upload_release_archive.sh
@@ -17,8 +17,15 @@ then
BUCKET="libpod-pr-releases"
elif [[ -n "$CIRRUS_BRANCH" ]]
then
- PR_OR_BRANCH="$CIRRUS_BRANCH"
- BUCKET="libpod-$CIRRUS_BRANCH-releases"
+ # Only release non-development tagged commit ranges
+ if is_release
+ then
+ PR_OR_BRANCH="$CIRRUS_BRANCH"
+ BUCKET="libpod-$CIRRUS_BRANCH-releases"
+ else
+ warn "" "Skipping release processing: Commit range|CIRRUS_TAG is development tagged."
+ exit 0
+ fi
else
die 1 "Expecting either \$CIRRUS_PR or \$CIRRUS_BRANCH to be non-empty."
fi
@@ -64,6 +71,10 @@ do
echo "Warning: Not processing $filename (invalid extension '$EXT')"
continue
fi
+ if [[ "$EXT" =~ "gz" ]]
+ then
+ EXT="tar.gz"
+ fi
[[ "$OS_RELEASE_ID" == "ubuntu" ]] || \
chcon -t container_file_t "$filename"