diff --git a/.circleci/config.yml b/.circleci/config.yml index d439ea5..21771ff 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 @@ -72,7 +43,7 @@ jobs: - *set_environment_variables - *docker_build_and_push - release: + release-binary: docker: - image: circleci/golang:1.13 environment: @@ -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: