build: update circle config to exit from forks on build step (#21458)

* build: update circle config to exit from forks on build step

* build: skip e2e step entirely for forks
pull/21460/head
William Baker 2021-05-11 12:31:43 -04:00 committed by GitHub
parent 0e02166ed0
commit 4975266e18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 17 deletions

View File

@ -30,6 +30,9 @@ workflows:
requires:
- godeps
- e2e-monitor-ci:
filters:
branches:
ignore: /pull\/[0-9]+/
requires:
- build
- grace_daily:
@ -127,13 +130,7 @@ commands:
- when:
condition: << parameters.publish_release >>
steps:
- run:
name: Ensure not running from a fork
command: |
if [ -n "$CIRCLE_PR_NUMBER" ]; then
echo 'Error: release from fork detected, exiting!'
exit 1
fi
- bail_if_forked
- run:
name: Import GPG key
command: |
@ -278,17 +275,13 @@ commands:
command: docker login -u "$QUAY_USER" -p $QUAY_PASS quay.io
bail_if_forked:
parameters:
exit_code:
type: integer
default: 1
steps:
- run:
name: Exit if running from a fork
command: |
if [ -n "$CIRCLE_PR_NUMBER" ]; then
echo 'Error: Running from a fork, exiting!'
exit << parameters.exit_code >>
exit 1
fi
jobs:
@ -522,9 +515,12 @@ jobs:
- bin/linux/influx
- etc/litmus_success_notify.sh
- etc/litmus_fail_notify.sh
# if we are running on a fork, exit with success now instead of building & pushing a docker image.
- bail_if_forked:
exit_code: 0
- run:
name: Exit the job with success if running on a fork
command: |
if [ -n "$CIRCLE_PR_NUMBER" ]; then
circleci-agent step halt
fi
- setup_remote_docker:
version: 19.03.13
docker_layer_caching: true
@ -618,8 +614,6 @@ jobs:
docker:
- image: cimg/go:1.15.6
steps:
# if we are running from a fork, exit with a fail status.
- bail_if_forked
- checkout
- run:
name: Run the tests