-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle multiple tags on the same commit
- Loading branch information
Showing
2 changed files
with
41 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (C) 2021 ScyllaDB | ||
# | ||
# This script will set appropriate tag variables in the CI environment. | ||
# Multiple tags can point to one commit which makes `git describe` ambiguous | ||
# for the purposes of promotion. Like when vX.Y.Z-beta.0 and vX.Y.Z-rc.0 point | ||
# to the same commit. Git describe could return any of those and even if it would | ||
# return the newest, the job order is not determined either. And jobs can be rerun | ||
# which would make the beta job promoting to rc.0. | ||
set -euExo pipefail | ||
shopt -s inherit_errexit | ||
|
||
parent_dir=$( dirname "${BASH_SOURCE[0]}" ) | ||
source "${parent_dir}/lib/tag-from-gh-ref.sh" | ||
|
||
tag=$( tag_from_gh_ref "${GITHUB_REF}" ) | ||
git_sha=$( git rev-parse --short=7 "HEAD^{commit}" ) | ||
|
||
echo "GIT_TAG=${tag}-0-g${git_sha}" | tee -a ${GITHUB_ENV} | ||
echo "GIT_TAG_SHORT=${tag}" | tee -a ${GITHUB_ENV} |