Skip to content

Commit

Permalink
don't push docker images on forked PRs (#291)
Browse files Browse the repository at this point in the history
* don't push docker images on forked PRs

* fix name
  • Loading branch information
rbren authored May 18, 2020
1 parent 450d065 commit a3e9939
Showing 1 changed file with 31 additions and 10 deletions.
41 changes: 31 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,23 @@ references:
echo "8dbad6683d6fc9367e637e6eed8e01a0d63c9660 goreleaser.deb" | sha1sum -c
sudo dpkg -i goreleaser.deb
rm goreleaser.deb
docker_build: &docker_build
run:
name: Docker login and build
command: |
docker-pull -f .circleci/build.config
docker-build -f .circleci/build.config
docker_build_and_push: &docker_build_and_push
run:
name: Docker login, build, and push
command: |
docker-pull -f .circleci/build.config
docker-build -f .circleci/build.config
if [[ -z $CIRCLE_PR_NUMBER ]]; then
docker login quay.io -u="${fairwinds_quay_user}" -p="${fairwinds_quay_token}"
docker-push -f .circleci/build.config
else
echo "Skipping docker push for forked PR"
fi
docker login quay.io -u="${fairwinds_quay_user}" -p="${fairwinds_quay_token}"
docker-push -f .circleci/build.config
release_deploy_configs: &release_deploy_configs
run:
name: Release deploy configs
Expand All @@ -112,6 +117,15 @@ references:
jobs:
build:
docker:
- image: quay.io/reactiveops/ci-images:v8.0-stretch
steps:
- checkout
- setup_remote_docker
- *set_environment_variables
- *docker_build

push:
docker:
- image: quay.io/reactiveops/ci-images:v8.0-stretch
steps:
Expand Down Expand Up @@ -170,20 +184,27 @@ jobs:

workflows:
version: 2

build:
jobs:
- test
- build:
requires:
- test
- push:
context: org-global
# Allow using testing tags for testing circle test + build steps
requires:
- build
filters:
tags:
only: /^testing-.*/
branches:
ignore: /pull\/[0-9]+/
- test_k8s:
requires:
- build
- push
filters:
branches:
ignore: /pull\/[0-9]+/

release:
jobs:
- release_binary:
Expand Down

0 comments on commit a3e9939

Please sign in to comment.