Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.

Commit 681ceb7

Browse files
authored
fix: disable some jobs for forked prs (#880)
* fix: Revert "Revert "chore: add job to trigger intergation tests in buildbot" (#878)" This reverts commit 005d087. * fix: Add branch filter for integration tests for forked PRs
1 parent d894cb5 commit 681ceb7

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.circleci/config.yml

+33
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,31 @@ jobs:
309309
image: << parameters.container-image >>
310310
tag: "${IMAGE_TAG_LIST}"
311311

312+
integration-tests:
313+
docker:
314+
- image: cimg/base:current
315+
steps:
316+
- run:
317+
name: Sanitize branch name
318+
command: echo export "BRANCH=${CIRCLE_BRANCH//\//-}" >> "$BASH_ENV"
319+
- run:
320+
name: Set payload
321+
command: |
322+
json_data='{
323+
"parameters":{
324+
"run-workflow-build-executer": true,
325+
"run-workflow-test-build-and-push": false,
326+
"run-workflow-integration-tests-only": true
327+
}
328+
}'; PAYLOAD=$(echo $json_data | jq --arg sha $BRANCH '.parameters["image-sha"]=$sha'); \
329+
echo "export PAYLOAD='${PAYLOAD}'" >> "$BASH_ENV"
330+
- run:
331+
name: Trigger buildbot integration tests pipeline
332+
command: |
333+
curl --location --request POST 'https://circleci.com/api/v2/project/github/netlify/buildbot/pipeline' \
334+
--header 'Content-Type: application/json' \
335+
-u "${CIRCLE_API_TOKEN}:" \
336+
--data "${PAYLOAD}"
312337
# Workflows are where we specify the job order and job parameters (if applicable)
313338
workflows:
314339
# Workflow responsible for building git tags (commonly the final releases we use within buildbot)
@@ -363,6 +388,14 @@ workflows:
363388
requires:
364389
- build-test-and-push-image
365390

391+
- integration-tests:
392+
filters:
393+
branches:
394+
ignore: /pull\/[0-9]+/ # Forked pull requests have CIRCLE_BRANCH set to pull/XXX
395+
requires:
396+
- build-test-and-push-image
397+
- create-multi-arch-image
398+
366399
########################################################################
367400
# FORKED PRS
368401
# Those jobs just apply to forked PRs

0 commit comments

Comments
 (0)