mirror of https://github.com/hashicorp/consul
Override cla check and add slack notifications (#6007)
* override CLA check * add slack notifications for merge * don't delete unmerged branch to ease debuggingpull/6017/head
parent
813e009a2d
commit
cf26656863
|
@ -487,16 +487,55 @@ jobs:
|
||||||
| jq --raw-output '.[] | select(.outcome!="success") | "\(.workflows.job_name): \(.build_url)"')"
|
| jq --raw-output '.[] | select(.outcome!="success") | "\(.workflows.job_name): \(.build_url)"')"
|
||||||
if [[ -n "${unsuccessful_builds}" ]]; then
|
if [[ -n "${unsuccessful_builds}" ]]; then
|
||||||
printf "master merge CI pipeline jobs failed:\n${unsuccessful_builds}\n"
|
printf "master merge CI pipeline jobs failed:\n${unsuccessful_builds}\n"
|
||||||
git push --delete origin "${git_merge_branch}"
|
curl -X POST -H 'Content-type: application/json' \
|
||||||
|
--data \
|
||||||
|
"{ \
|
||||||
|
\"attachments\": [ \
|
||||||
|
{ \
|
||||||
|
\"fallback\": \"Nightly Master Merge Failed!\", \
|
||||||
|
\"text\": \"Nightly *master* merge into *release/1-6* failed!\n\nBuild Log: ${CIRCLE_BUILD_URL}\n\nAttempted merge from: https://github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/tree/${git_merge_branch}\n\nThere may be a merge conflict to resolve.\", \
|
||||||
|
\"footer\": \"${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}\", \
|
||||||
|
\"ts\": \"$(date +%s)\", \
|
||||||
|
\"color\": \"danger\" \
|
||||||
|
} \
|
||||||
|
] \
|
||||||
|
}" ${CONSUL_SLACK_WEBHOOK_URL}
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
current_ref=$(git rev-parse HEAD)
|
||||||
|
# Set CLA check to pass
|
||||||
|
echo "Setting CLA check"
|
||||||
|
curl -u "${HASHICORP_CI_GITHUB_TOKEN}:" -X POST \
|
||||||
|
--header "Accept: application/json" \
|
||||||
|
--show-error \
|
||||||
|
--silent \
|
||||||
|
--fail \
|
||||||
|
--output /dev/null \
|
||||||
|
-d "{ \"state\": \"success\", \
|
||||||
|
\"target_url\": \"https://cla.hashicorp.com/hashicorp/consul\", \
|
||||||
|
\"description\": \"Contributor License Agreement is signed.\", \
|
||||||
|
\"context\": \"license/cla\"}" https://api.github.com/repos/hashicorp/consul/statuses/${current_ref}
|
||||||
|
|
||||||
# CircleCI jobs passed, merging to release branch
|
# CircleCI jobs passed, merging to release branch
|
||||||
echo "master merge CI pipeline passed successfully so merging to ${CIRCLE_BRANCH}!"
|
echo "master merge CI pipeline passed successfully so merging to ${CIRCLE_BRANCH}!"
|
||||||
git checkout "${CIRCLE_BRANCH}"
|
git checkout "${CIRCLE_BRANCH}"
|
||||||
git merge "${git_merge_branch}"
|
git merge "${git_merge_branch}"
|
||||||
git push origin "${CIRCLE_BRANCH}"
|
git push origin "${CIRCLE_BRANCH}"
|
||||||
git push --delete origin "${git_merge_branch}"
|
git push --delete origin "${git_merge_branch}"
|
||||||
|
curl -X POST -H 'Content-type: application/json' \
|
||||||
|
--data \
|
||||||
|
"{ \
|
||||||
|
\"attachments\": [ \
|
||||||
|
{ \
|
||||||
|
\"fallback\": \"Nightly master merge success!\", \
|
||||||
|
\"text\": \"Nightly *master* merge into *release/1-6* succeeded!\", \
|
||||||
|
\"footer\": \"${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}\", \
|
||||||
|
\"ts\": \"$(date +%s)\", \
|
||||||
|
\"color\": \"good\" \
|
||||||
|
} \
|
||||||
|
] \
|
||||||
|
}" ${CONSUL_SLACK_WEBHOOK_URL}
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
|
|
Loading…
Reference in New Issue