Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare CI for our internal release train #828

Merged
merged 4 commits into from
Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .drone/drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ trigger:
ref:
- refs/heads/main
- refs/tags/**
- refs/heads/r? # For weekly release
- refs/heads/r?? # For weekly release
yvrhdn marked this conversation as resolved.
Show resolved Hide resolved

---
## AMD64 ##
Expand Down Expand Up @@ -90,6 +92,8 @@ trigger:
ref:
- refs/heads/main
- refs/tags/v*
- refs/heads/r? # For weekly release
- refs/heads/r?? # For weekly release

---
## ARM64 ##
Expand Down Expand Up @@ -144,6 +148,8 @@ trigger:
ref:
- refs/heads/main
- refs/tags/v*
- refs/heads/r? # For weekly release
- refs/heads/r?? # For weekly release

---
## MANIFEST ##
Expand Down Expand Up @@ -189,6 +195,8 @@ trigger:
ref:
- refs/heads/main
- refs/tags/v*
- refs/heads/r? # For weekly release
- refs/heads/r?? # For weekly release

---
kind: secret
Expand Down
14 changes: 10 additions & 4 deletions tools/image-tag
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@

annanay25 marked this conversation as resolved.
Show resolved Hide resolved
set -o errexit
set -o nounset
set -o pipefail

SHA="$(git rev-parse --short HEAD)"
WIP=$(git diff --quiet || echo '-WIP')
yvrhdn marked this conversation as resolved.
Show resolved Hide resolved
BRANCH=$(git rev-parse --abbrev-ref HEAD | sed 's#/#-#g')
# When 7 chars are not enough to be unique, git automatically uses more.
# We are forcing to 7 here, as we are doing for grafana/grafana as well.
SHA=$(git rev-parse --short=7 HEAD | head -c7)

# If not a tag, use branch-hash else use tag
TAG=$((git describe --exact-match 2> /dev/null || echo "") | sed 's/v//g')

# If tag, use tag
TAG=$( (git describe --exact-match 2> /dev/null || echo "") | sed 's/v//g')
if [ -z "$TAG" ]
then
echo ${SHA}
echo ${BRANCH}-${SHA}${WIP}
jvrplmlmn marked this conversation as resolved.
Show resolved Hide resolved
else
echo ${TAG}
fi