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 forkspull/21460/head
parent
0e02166ed0
commit
4975266e18
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue