Skip to content

Commit

Permalink
Push image on release
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 23, 2020
1 parent b5bad18 commit 163ee5b
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 23 deletions.
66 changes: 45 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
version: 2.1

orbs:
docker: circleci/docker@1.4.0

jobs:
test:
docker:
Expand Down Expand Up @@ -61,42 +64,63 @@ 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
- setup_remote_docker
- run:
name: Build image
command: docker build --pull --progress plain -t instrumenta/conftest .
environment:
DOCKER_BUILDKIT: 1
DOCKER_API_VERSION: 1.39
command: docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
- docker/build:
image: open-policy-agent/conftest

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

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

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: open-policy-agent/conftest
tag: $CIRCLE_TAG,latest
- docker/push:
image: open-policy-agent/conftest
tag: $CIRCLE_TAG,latest
- docker/build:
image: open-policy-agent/conftest
extra_build_args: '--target examples'
tag: examples
- docker/push:
image: open-policy-agent/conftest
tag: examples

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

0 comments on commit 163ee5b

Please sign in to comment.