summaryrefslogtreecommitdiff
path: root/scripts/sync-stable-branch.sh
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-24 18:07:05 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-24 18:07:05 +0000
commitc4edbefa458319a81e238f8f034d19f6ea6292ca (patch)
treee09a53528a8ee7b0657ed80931c6e7ceff1eccc2 /scripts/sync-stable-branch.sh
parent8db8e2a34205c67e358cf544745d9eaeb30cd032 (diff)
downloadgitlab-ce-c4edbefa458319a81e238f8f034d19f6ea6292ca.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts/sync-stable-branch.sh')
-rw-r--r--scripts/sync-stable-branch.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/sync-stable-branch.sh b/scripts/sync-stable-branch.sh
new file mode 100644
index 00000000000..fc62453d743
--- /dev/null
+++ b/scripts/sync-stable-branch.sh
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+
+# This script triggers a merge train job to sync an EE stable branch to its
+# corresponding CE stable branch.
+
+set -e
+
+if [[ "$MERGE_TRAIN_TRIGGER_TOKEN" == '' ]]
+then
+ echo 'The variable MERGE_TRAIN_TRIGGER_TOKEN must be set to a non-empy value'
+ exit 1
+fi
+
+if [[ "$MERGE_TRAIN_TRIGGER_URL" == '' ]]
+then
+ echo 'The variable MERGE_TRAIN_TRIGGER_URL must be set to a non-empy value'
+ exit 1
+fi
+
+if [[ "$CI_COMMIT_REF_NAME" == '' ]]
+then
+ echo 'The variable CI_COMMIT_REF_NAME must be set to a non-empy value'
+ exit 1
+fi
+
+curl -X POST \
+ -F token="$MERGE_TRAIN_TRIGGER_TOKEN" \
+ -F ref=master \
+ -F "variables[MERGE_FOSS]=1" \
+ -F "variables[SOURCE_BRANCH]=$CI_COMMIT_REF_NAME" \
+ -F "variables[TARGET_BRANCH]=${CI_COMMIT_REF_NAME/-ee/}" \
+ "$MERGE_TRAIN_TRIGGER_URL"