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.
pull/2526/head
Timothy Messier 3 years ago committed by GitHub
parent 51de0878c3
commit f39833ebad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

40
.circleci/config.yml generated

@ -16,6 +16,17 @@ jobs:
command: |
make test-sql POSTGRES_DOCKER_IMAGE_BASE=docker.mirror.hashicorp.services/postgres PG_DOCKER_TAG=13-alpine
name: Run SQL PgTap Tests
trigger-merge-to-downstream:
machine:
image: ubuntu-2004:202111-01
resource_class: medium
working_directory: ~/boundary
steps:
- checkout
- run:
command: |
./scripts/trigger-merge-to-downstream ${CIRCLE_BRANCH}
name: Trigger Merge to Downstream
test-api:
machine:
image: ubuntu-2004:202111-01
@ -275,17 +286,6 @@ jobs:
name: Slack - Sending Status Alert
shell: /bin/bash
when: always
trigger-merge-to-ent:
machine:
image: ubuntu-2004:202111-01
resource_class: medium
working_directory: ~/boundary
steps:
- checkout
- run:
command: |
./scripts/trigger-merge-to-ent
name: Trigger Merge to Enterprise
test-sql-latest:
machine:
image: ubuntu-2004:202111-01
@ -308,13 +308,14 @@ workflows:
- test-sql-12-alpine
- test-sql-13-alpine
- make-gen-deltas
trigger-merge-to-ent:
trigger-merge-to-downstream:
jobs:
- trigger-merge-to-ent:
- trigger-merge-to-downstream:
filters:
branches:
only:
- main
- /release\/.*/
version: 2
# Original config.yml file:
@ -424,14 +425,14 @@ workflows:
# command: |
# make test-sql POSTGRES_DOCKER_IMAGE_BASE=docker.mirror.hashicorp.services/postgres PG_DOCKER_TAG=<< parameters.postgres-version >>
# name: Run SQL PgTap Tests
# trigger-merge-to-ent:
# trigger-merge-to-downstream:
# executor: go-machine-medium
# steps:
# - checkout
# - run:
# command: |
# ./scripts/trigger-merge-to-ent
# name: Trigger Merge to Enterprise
# ./scripts/trigger-merge-to-downstream ${CIRCLE_BRANCH}
# name: Trigger Merge to Downstream
# orbs:
# slack: circleci/slack@3.4.2
# version: 2.1
@ -450,10 +451,11 @@ workflows:
# - 12-alpine
# - 13-alpine
# - make-gen-deltas
# trigger-merge-to-ent:
# trigger-merge-to-downstream:
# jobs:
# - trigger-merge-to-ent:
# - trigger-merge-to-downstream:
# filters:
# branches:
# only:
# - main
# - main
# - /release\\/.*/

@ -0,0 +1,7 @@
executor: go-machine-medium
steps:
- checkout
- run:
name: "Trigger Merge to Downstream"
command: |
./scripts/trigger-merge-to-downstream ${CIRCLE_BRANCH}

@ -1,7 +0,0 @@
executor: go-machine-medium
steps:
- checkout
- run:
name: "Trigger Merge to Enterprise"
command: |
./scripts/trigger-merge-to-ent

@ -1,6 +1,7 @@
jobs:
- trigger-merge-to-ent:
- trigger-merge-to-downstream:
filters:
branches:
only:
- main
- /release\/.*/

@ -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
Loading…
Cancel
Save