Skip to content

Commit

Permalink
fix export-git-env-vars script
Browse files Browse the repository at this point in the history
  • Loading branch information
dkijania committed Sep 16, 2024
1 parent dcb19df commit 66ccf9f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
6 changes: 3 additions & 3 deletions buildkite/scripts/export-git-env-vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ function find_most_recent_numeric_tag() {
}

export GITHASH=$(git rev-parse --short=7 HEAD)
export GITBRANCH=$(git rev-parse --symbolic-full-name --abbrev-ref HEAD | sed 's!/!-!g; s!_!-!g; s!#!-!g' )

export THIS_COMMIT_TAG=$(git tag --points-at HEAD)
export PROJECT="mina"
Expand All @@ -26,8 +25,9 @@ export BUILD_URL=${BUILDKITE_BUILD_URL}
set -u

export MINA_DEB_CODENAME=${MINA_DEB_CODENAME:=bullseye}
[[ -n "$BUILDKITE_BRANCH" ]] && export GITBRANCH=$(echo "$BUILDKITE_BRANCH" | sed 's!/!-!g; s!_!-!g; s!#!-!g')

[[ -n "$BUILDKITE_BRANCH" ]] && export GITBRANCH=$(echo "$BUILDKITE_BRANCH" | sed 's!/!-!g; s!_!-!g; s!#!-!g') || export GITBRANCH=$(git name-rev --name-only $GITHASH | sed "s/remotes\/origin\///g" | sed 's!/!-!g; s!_!-!g; s!#!-!g' )


export RELEASE=unstable

if [ "${BUILDKITE_REPO}" != "${MINA_REPO}" ]; then
Expand Down
6 changes: 0 additions & 6 deletions scripts/export-git-env-vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ set -x

# In case of running this script on detached head, script has difficulties in finding out
# what is the current
while [[ "$#" -gt 0 ]]; do case $1 in
-b|--branch-name) BRANCH_NAME="$2"; shift;;
*) echo "Unknown parameter passed: $1"; exit 1;;
esac; shift; done

echo "Exporting Git Variables: "

git fetch
Expand All @@ -27,7 +22,6 @@ function find_most_recent_numeric_tag() {
export GITHASH=$(git rev-parse --short=7 HEAD)
export THIS_COMMIT_TAG=$(git tag --points-at HEAD)

export GITBRANCH=$(git name-rev --name-only $GITHASH | sed "s/remotes\/origin\///g" | sed 's!/!-!g; s!_!-!g; s!#!-!g' )
[[ -n "$BRANCH_NAME" ]] && export GITBRANCH=$(echo "$BRANCH_NAME" | sed 's!/!-!g; s!_!-!g; s!#!-!g') || export GITBRANCH=$(git name-rev --name-only $GITHASH | sed "s/remotes\/origin\///g" | sed 's!/!-!g; s!_!-!g; s!#!-!g' )

export GITTAG=$(find_most_recent_numeric_tag HEAD)
Expand Down

0 comments on commit 66ccf9f

Please sign in to comment.