Skip to content

Commit 638c876

Browse files
authored
Update release.sh to push branch & tag to GitHub. (#68)
1 parent 0b223b7 commit 638c876

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

release.sh

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/sh
22

33
version="$1"
4+
versioned_release_branch="release-${version}"
5+
versioned_release_tag="v${version}"
46

57
if [[ -z "${version}" ]]; then
68
echo "Please provide a version: ./release.sh {VERSION}"
@@ -21,7 +23,24 @@ fi
2123
echo "${version}" > VERSION
2224

2325
# 2. Create a git branch for the version, e.g. `release-0.3.1`.
24-
git checkout -b "release-${version}"
26+
git checkout -b "${versioned_release_branch}"
2527

26-
# 3. Run `DOCKER_IMAGE_NAME={public_docker_image} make push`.
28+
# 3. Commit the version update.
29+
git add VERSION
30+
git commit -m "Update version to ${version}."
31+
32+
# 4. Run `DOCKER_IMAGE_NAME={public_docker_image} make push`.
2733
DOCKER_IMAGE_NAME="gcr.io/stackdriver-prometheus/stackdriver-prometheus-sidecar" make push
34+
35+
################################
36+
# Push branch and tag to GitHub
37+
################################
38+
# 1. Tag the commit to a specific version, e.g. `v0.3.1`.
39+
git tag "${versioned_release_tag}"
40+
41+
# 2. Push release branch to GitHub.
42+
git push https://github.com/Stackdriver/stackdriver-prometheus-sidecar.git "${versioned_release_branch}"
43+
44+
# 3. Push tag to GitHub.
45+
git push https://github.com/Stackdriver/stackdriver-prometheus-sidecar.git "${versioned_release_tag}"
46+

0 commit comments

Comments
 (0)