File tree Expand file tree Collapse file tree 2 files changed +32
-44
lines changed
Expand file tree Collapse file tree 2 files changed +32
-44
lines changed Original file line number Diff line number Diff line change 22
33set -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+
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments