Skip to content

Commit d5e5ee1

Browse files
committed
fix master version to prevtag+internal.rev_count
1 parent 445b6e2 commit d5e5ee1

File tree

2 files changed

+32
-44
lines changed

2 files changed

+32
-44
lines changed

scripts/update-version.sh

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,35 @@
22

33
set -eux
44

5-
source scripts/version-common.sh
6-
update_version
5+
#!/bin/bash
6+
7+
set -eu
8+
9+
git fetch --tags --force
10+
11+
PREV_TAG=`git describe --tags --abbrev=0`
12+
REV_COUNT=""
13+
VERSION=""
14+
15+
# when executing this script with a git tag defined by buildkite, we are releasing to production
16+
if [[ ${BUILDKITE_TAG:-""} != "" ]]; then
17+
VERSION="$BUILDKITE_TAG"
18+
# when executing this script on the master branch, we are releasing internal versions
19+
elif [[ ${BUILDKITE_BRANCH:-} != "master" ]]; then
20+
VERSION=${PREV_TAG}
21+
22+
# if there are multiple revisions, append that revision number
23+
_REV_COUNT=$(git rev-list "${PREV_TAG}"..HEAD --count 2>/dev/null) || true
24+
if [[ ! -z "${_REV_COUNT:-}" ]]; then
25+
REV_COUNT=${_REV_COUNT}
26+
fi
27+
28+
if [[ ${REV_COUNT} != "" ]]; then
29+
VERSION="${PREV_TAG}+internal.${REV_COUNT}"
30+
fi
31+
fi
32+
33+
# write the generated version back to VERSION file which will be used in generation
34+
# of binaries
35+
echo -n "__version__ = \"${VERSION}\"" > ./blackfire_conprof/version.py
36+

scripts/version-common.sh

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)