chore: Add downstream merge triggers (#2524)
Trigger a downstream merge. This requires that the DOWNSTREAM_SLUG environment variable is set in CircleCI. This will trigger downstream merges for main and all release branches.
This commit is contained in:
1 parent
51de0878c3
commit
f39833ebad
6 files changed
+54
-44
No files matched your search
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
BRANCH=${1:="main"}
|
||||
|
||||
if [[ -z "${DOWNSTREAM_SLUG}" ]]; then
|
||||
echo "skipping, no downstream"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ -z "${CIRCLE_REPOSITORY_URL}" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "${CIRCLE_REPOSITORY_URL}" == *"boundary-${DOWNSTREAM_SLUG}"* ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ -z ${CIRCLE_CI_DOWNSTREAM_TOK} ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
curl -u "${CIRCLE_CI_DOWNSTREAM_TOK}:" \
|
||||
-d "build_parameters[CIRCLE_JOB]=merge-from-upstream" \
|
||||
"https://circleci.com/api/v1.1/project/github/hashicorp/boundary-${DOWNSTREAM_SLUG}/tree/${BRANCH}"
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ -z "${CIRCLE_REPOSITORY_URL}" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "${CIRCLE_REPOSITORY_URL}" == *"boundary-enterprise"* ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ -z ${CIRCLE_CI_ENT_TOK} ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
curl -u ${CIRCLE_CI_ENT_TOK}: \
|
||||
-d 'build_parameters[CIRCLE_JOB]=merge-oss-main' \
|
||||
https://circleci.com/api/v1.1/project/github/hashicorp/boundary-enterprise/tree/main
|
||||
Reference in new issue
Block a user