From fff333fba2157e6c4ba64b4b780974faabb0a0b3 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Thu, 15 Dec 2016 12:07:34 +0100 Subject: [PATCH] Add "make release" script --- Makefile | 3 +++ _support/release.sh | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 _support/release.sh diff --git a/Makefile b/Makefile index 3f6ac9158cc7..47114d2a9215 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,9 @@ clean: clean-workhorse clean-build clean-workhorse: cd ${BUILD_DIR} && rm -f gitlab-workhorse gitlab-zip-cat gitlab-zip-metadata +release: + sh _support/release.sh + .PHONY: clean-build clean-build: rm -rf ${BUILD_DIR}/_build diff --git a/_support/release.sh b/_support/release.sh new file mode 100644 index 000000000000..350154134a4c --- /dev/null +++ b/_support/release.sh @@ -0,0 +1,31 @@ +set -e + +remotes='https://dev.gitlab.org/gitlab/gitlab-workhorse.git https://gitlab.com/gitlab-org/gitlab-workhorse.git' + +main() { + get_version + tag_name="v${version}" + git tag -m "Version ${version}" -a ${tag_name} + git show ${tag_name} + echo + echo "Does this look OK? Enter 'yes' to push to ${remotes}" + read confirmation + if [ "x${confirmation}" != xyes ] ; then + echo "Aborting" + exit 1 + fi + for r in ${remotes}; do + git push "${r}" HEAD ${tag_name} + done +} + +get_version() { + v=$(sed 1q VERSION) + if ! echo "${v}" | grep -q '^[0-9]\+\.[0-9]\+\.[0-9]\+$' ; then + echo "Invalid VERSION: ${v}" + exit 1 + fi + version="${v}" +} + +main \ No newline at end of file -- GitLab