Skip to content

Commit

Permalink
use rok8s orb
Browse files Browse the repository at this point in the history
  • Loading branch information
rbren committed Jun 2, 2020
1 parent fc006a5 commit 924cf76
Showing 1 changed file with 21 additions and 42 deletions.
63 changes: 21 additions & 42 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,6 @@ version: 2.1
orbs:
rok8s: fairwinds/rok8s-scripts@11

references:
set_environment_variables: &set_environment_variables
run:
name: Set Environment Variables
command: |
echo 'export REPO=quay.io/fairwinds/nova' >> ${BASH_ENV}
echo 'export GO111MODULE=on' >> ${BASH_ENV}
echo 'export CI_SHA1=$CIRCLE_SHA1' >> ${BASH_ENV}
echo 'export CI_BRANCH=$CIRCLE_BRANCH' >> ${BASH_ENV}
echo 'export CI_BUILD_NUM=$CIRCLE_BUILD_NUM' >> ${BASH_ENV}
echo 'export CI_TAG=$CIRCLE_TAG' >> ${BASH_ENV}
echo 'export PUSH_ALL_VERSION_TAGS=true' >> ${BASH_ENV}
docker_build: &docker_build
run:
name: Docker Build
command: |
docker-pull -f deploy/build.config
docker-build -f deploy/build.config
docker_build_and_push: &docker_build_and_push
run:
name: Docker Build and Push
command: |
docker login quay.io -u="${fairwinds_quay_user}" -p="${fairwinds_quay_token}"
docker-pull -f deploy/build.config
docker-build -f deploy/build.config
docker-push -f deploy/build.config
jobs:
test:
working_directory: /go/src/github.com/fairwindsops/nova
Expand Down Expand Up @@ -72,7 +43,7 @@ jobs:
- *set_environment_variables
- *docker_build_and_push

release:
release-binary:
docker:
- image: circleci/golang:1.13
environment:
Expand All @@ -82,32 +53,40 @@ jobs:
- setup_remote_docker
- run: curl -sL http://git.io/goreleaser | bash

deploy-prod:
executor: rok8s/ci-images
steps:
- checkout
- rok8s/set_env
- run: prepare-kubectl
- run: helm-deploy -f deploy/prod.config

workflows:
version: 2
test_and_build:
jobs:
- test
- build
- push:
- rok8s/docker_build_and_push:
name: build-and-push-container
docker-push: false
enable_docker_layer_caching: true
config_file: .circleci/build.config
requires:
- test
filters:
branches:
only: /pull\/[0-9]+/
- rok8s/docker_build_and_push:
name: build-and-push-container
docker-push: true
enable_docker_layer_caching: true
config_file: .circleci/build.config
context: org-global
docker-login: true
password-variable: "fairwinds_quay_token"
registry: quay.io
username: fairwinds+circleci
requires:
- test
- build
filters:
branches:
ignore: /pull\/[0-9]+/

release:
jobs:
- release:
- release-binary:
context: org-global
filters:
branches:
Expand Down

0 comments on commit 924cf76

Please sign in to comment.