mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
Avoid to leverage on git local commands to guess the local branch, it switches to listing the branches and checking against the the stack version. If doesn't exists it's main
(cherry picked from commit 11ecaaea5a
)
Co-authored-by: Andrea Selva <selva.andre@gmail.com>
This commit is contained in:
parent
60765f5ad1
commit
3d85ea439d
1 changed files with 8 additions and 1 deletions
|
@ -13,7 +13,13 @@ STACK_VERSION=`cat versions.yml | sed -n 's/^logstash\:[[:space:]]\([[:digit:]]*
|
||||||
|
|
||||||
# This is the branch selector that needs to be passed to the release-manager
|
# This is the branch selector that needs to be passed to the release-manager
|
||||||
# It has to be the name of the branch which originates the artifacts.
|
# It has to be the name of the branch which originates the artifacts.
|
||||||
RELEASE_BRANCH=`git rev-parse --abbrev-ref HEAD`
|
RELEASE_VER=`cat versions.yml | sed -n 's/^logstash\:[[:space:]]\([[:digit:]]*\.[[:digit:]]*\)\.[[:digit:]]*$/\1/p'`
|
||||||
|
if [ -n "$(git ls-remote --heads origin $RELEASE_VER)" ] ; then
|
||||||
|
RELEASE_BRANCH=$RELEASE_VER
|
||||||
|
else
|
||||||
|
RELEASE_BRANCH=main
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "$VERSION_QUALIFIER_OPT" ]; then
|
if [ -n "$VERSION_QUALIFIER_OPT" ]; then
|
||||||
# Qualifier is passed from CI as optional field and specify the version postfix
|
# Qualifier is passed from CI as optional field and specify the version postfix
|
||||||
# in case of alpha or beta releases:
|
# in case of alpha or beta releases:
|
||||||
|
@ -26,6 +32,7 @@ if [ -n "$WORKFLOW_TYPE" ]; then
|
||||||
STACK_VERSION=${STACK_VERSION}-SNAPSHOT
|
STACK_VERSION=${STACK_VERSION}-SNAPSHOT
|
||||||
WORKFLOW="snapshot"
|
WORKFLOW="snapshot"
|
||||||
fi
|
fi
|
||||||
|
echo "Uploading artifacts for ${WORKFLOW} workflow on branch: ${RELEASE_BRANCH}"
|
||||||
|
|
||||||
echo "Download all the artifacts for version ${STACK_VERSION}"
|
echo "Download all the artifacts for version ${STACK_VERSION}"
|
||||||
mkdir build/
|
mkdir build/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue