diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /scripts/sync-stable-branch.sh | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'scripts/sync-stable-branch.sh')
-rw-r--r-- | scripts/sync-stable-branch.sh | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/scripts/sync-stable-branch.sh b/scripts/sync-stable-branch.sh index 5aaec323628..59ab52844fb 100644 --- a/scripts/sync-stable-branch.sh +++ b/scripts/sync-stable-branch.sh @@ -7,56 +7,56 @@ set -e if [[ "$MERGE_TRAIN_TRIGGER_TOKEN" == '' ]] then - echo 'The variable MERGE_TRAIN_TRIGGER_TOKEN must be set to a non-empty value' - exit 1 + echo 'The variable MERGE_TRAIN_TRIGGER_TOKEN must be set to a non-empty value' + exit 1 fi if [[ "$MERGE_TRAIN_TRIGGER_URL" == '' ]] then - echo 'The variable MERGE_TRAIN_TRIGGER_URL must be set to a non-empty value' - exit 1 + echo 'The variable MERGE_TRAIN_TRIGGER_URL must be set to a non-empty value' + exit 1 fi if [[ "$CI_COMMIT_REF_NAME" == '' ]] then - echo 'The variable CI_COMMIT_REF_NAME must be set to a non-empty value' - exit 1 + echo 'The variable CI_COMMIT_REF_NAME must be set to a non-empty value' + exit 1 fi if [[ "$SOURCE_PROJECT" == '' ]] then - echo 'The variable SOURCE_PROJECT must be set to a non-empty value' - exit 1 + echo 'The variable SOURCE_PROJECT must be set to a non-empty value' + exit 1 fi if [[ "$TARGET_PROJECT" == '' ]] then - echo 'The variable TARGET_PROJECT must be set to a non-empty value' - exit 1 + echo 'The variable TARGET_PROJECT must be set to a non-empty value' + exit 1 fi if [[ "$TARGET_PROJECT" != "gitlab-org/gitlab-foss" ]] then - echo 'This is a security FOSS merge train' - echo "Checking if $CI_COMMIT_SHA is available on canonical" + echo 'This is a security FOSS merge train' + echo "Checking if $CI_COMMIT_SHA is available on canonical" - gitlab_com_commit_status=$(curl -s "https://gitlab.com/api/v4/projects/278964/repository/commits/$CI_COMMIT_SHA" | jq -M .status) + gitlab_com_commit_status=$(curl -s "https://gitlab.com/api/v4/projects/278964/repository/commits/$CI_COMMIT_SHA" | jq -M .status) - if [[ "$gitlab_com_commit_status" != "null" ]] - then - echo 'Commit available on canonical, skipping merge train' - exit 0 - fi + if [[ "$gitlab_com_commit_status" != "null" ]] + then + echo 'Commit available on canonical, skipping merge train' + exit 0 + fi - echo 'Commit not available, triggering a merge train' + echo 'Commit not available, triggering a merge train' 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/}" \ - -F "variables[SOURCE_PROJECT]=$SOURCE_PROJECT" \ - -F "variables[TARGET_PROJECT]=$TARGET_PROJECT" \ - "$MERGE_TRAIN_TRIGGER_URL" + -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/}" \ + -F "variables[SOURCE_PROJECT]=$SOURCE_PROJECT" \ + -F "variables[TARGET_PROJECT]=$TARGET_PROJECT" \ + "$MERGE_TRAIN_TRIGGER_URL" |