mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-11 07:20:22 +00:00
Compare commits
1 Commits
v1.12.2-rc
...
v1.0.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eccaa81af5 |
37
hack/gcr-push.sh
Executable file
37
hack/gcr-push.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Return value is written into LATEST
|
||||
LATEST=""
|
||||
function latest_release() {
|
||||
# Loop through the tags since pre-release versions come before the actual versions.
|
||||
# Iterate til we find the first non-pre-release
|
||||
for t in $(git tag -l --sort=-v:refname);
|
||||
do
|
||||
# If the tag has alpha, beta or rc in it, it's not "latest"
|
||||
if [[ "$t" == *"beta"* || "$t" == *"alpha"* || "$t" == *"rc"* ]]; then
|
||||
continue
|
||||
fi
|
||||
LATEST="$t"
|
||||
break
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
# Always publish for master
|
||||
if [ "$BRANCH" == "master" ]; then
|
||||
VERSION="$BRANCH" make all-containers all-push
|
||||
fi
|
||||
|
||||
# Publish when TRAVIS_TAG is defined.
|
||||
if [ ! -z "$TRAVIS_TAG" ]; then
|
||||
# Calculate the latest release
|
||||
latest_release
|
||||
|
||||
# Default to pre-release
|
||||
TAG_LATEST=false
|
||||
if [[ "$TRAVIS_TAG" == "$LATEST" ]]; then
|
||||
TAG_LATEST=true
|
||||
fi
|
||||
|
||||
VERSION="$TRAVIS_TAG" TAG_LATEST="$TAG_LATEST" make all-containers all-push
|
||||
fi
|
||||
Reference in New Issue
Block a user