Skip to content

Commit

Permalink
Add CircleCI workflow to push images automatically (#15)
Browse files Browse the repository at this point in the history
* Add CircleCI workflow to push images automatically

* Add release workflow
  • Loading branch information
kreamkorokke authored Nov 19, 2020
1 parent 68beacb commit 626a08f
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ version: 2.1

defaults: &defaults
docker:
- image: cimg/go:1.15
- image: docker.io/stackrox/apollo-ci:0.3.5
auth:
username: $DOCKER_IO_PULL_USERNAME
password: $DOCKER_IO_PULL_PASSWORD
working_directory: /home/circleci/go/src/github.com/stackrox/external-network-pusher

jobs:
Expand All @@ -24,6 +27,21 @@ jobs:
name: Run unit tests
command: |
make test
publish:
<<: *defaults
steps:
- run:
name: Login to gcr.io
command: |
gcloud auth activate-service-account --key-file <(echo "$PUSH_TO_GCR_STACKROX_HUB")
gcloud auth list
gcloud --quiet auth configure-docker
- setup_remote_docker
- checkout
- run:
name: Build and push image
command: make push

workflows:
build:
Expand All @@ -32,3 +50,18 @@ workflows:
context: docker-io-pull
- test:
context: docker-io-pull
- publish:
context:
- gcr-io-stackrox-hub-push
- docker-io-pull
release:
jobs:
- publish:
context:
- gcr-io-stackrox-hub-push
- docker-io-pull
filters:
branches:
ignore: /.*/
tags:
only: /.*/

0 comments on commit 626a08f

Please sign in to comment.