Skip to content

Commit

Permalink
Push image on release (#411)
Browse files Browse the repository at this point in the history
Signed-off-by: John Reese <john@reese.dev>
  • Loading branch information
jpreese committed Sep 27, 2020
1 parent b5bad18 commit 41c0f5e
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 24 deletions.
66 changes: 44 additions & 22 deletions .circleci/config.yml
@@ -1,5 +1,8 @@
---
version: 2.1

orbs:
docker: circleci/docker@1.4.0

jobs:
test:
docker:
Expand Down Expand Up @@ -61,42 +64,61 @@ jobs:
- store_artifacts:
path: ~/reports

image:
buildimage:
docker:
- image: circleci/buildpack-deps:stretch
- image: circleci/golang:1.13-node

steps:
- checkout
- setup_remote_docker:
version: 18.09.3
- run:
name: Build image
command: docker build --pull --progress plain -t instrumenta/conftest .
environment:
DOCKER_BUILDKIT: 1
DOCKER_API_VERSION: 1.39
- setup_remote_docker
- docker/build:
image: openpolicyagent/conftest

release:
release_docker:
docker:
- image: circleci/golang:1.13
- image: circleci/golang:1.13-node

steps:
- checkout
- run: curl -sL https://git.io/goreleaser | bash
- setup_remote_docker
- docker/check
- docker/build:
image: openpolicyagent/conftest
tag: $CIRCLE_TAG,latest
- docker/push:
image: openpolicyagent/conftest
tag: $CIRCLE_TAG,latest
- docker/build:
image: openpolicyagent/conftest
extra_build_args: '--target examples'
tag: examples
- docker/push:
image: openpolicyagent/conftest
tag: examples

release_binaries:
docker:
- image: circleci/golang:1.13-node

steps:
- checkout
- run:
name: Publish binaries
command: curl -sL https://git.io/goreleaser | bash

workflows:
version: 2
build:
jobs:
- test
- acceptance
- image:
- buildimage
- release_docker:
filters:
branches:
ignore: master
- image:
filters:
branches:
only: master
- release:
ignore: /.*/
tags:
only: /v[0-9]+(\.[0-9]+)*(-.*)*/
- release_binaries:
filters:
branches:
ignore: /.*/
Expand Down
2 changes: 0 additions & 2 deletions .dockerignore
Expand Up @@ -2,8 +2,6 @@
dist
README.md
CODE_OF_CONDUCT.md
LICENSE
contrib
docs
conftest*
Makefile

0 comments on commit 41c0f5e

Please sign in to comment.