Skip to content

Commit

Permalink
Combile Docker build and push precedure into a job
Browse files Browse the repository at this point in the history
  • Loading branch information
mozamimy committed May 11, 2019
1 parent 1b8f0a6 commit 2c0d7f0
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,15 @@ jobs:
- restore_cache:
key: 'v1-cargo-lock-{{ checksum "Cargo.lock"}}<<# parameters.release >>-release<</ parameters.release>>'
- run: 'cargo test <<# parameters.release >>--release --locked<</ parameters.release>>'
build_docker_image:
executor: 'docker'
steps:
- 'checkout'
- setup_remote_docker:
docker_layer_caching: true
- run: 'docker build --tag mozamimy/salmon:latest --tag mozamimy/salmon:${CIRCLE_TAG:1} --tag mozamimy/salmon:${CIRCLE_SHA1} .'
push_docker_image:
build_and_push_docker_image:
executor: 'docker'
environment:
DOCKER_USER: 'mozamimy'
steps:
- 'checkout'
- setup_remote_docker:
docker_layer_caching: true
- run: 'docker build --tag mozamimy/salmon:latest --tag mozamimy/salmon:${CIRCLE_TAG:1} --tag mozamimy/salmon:${CIRCLE_SHA1} .'
- run: 'docker login -u ${DOCKER_USER} -p ${DOCKER_PASSWORD}'
- run: 'docker push mozamimy/salmon:latest'
- run: 'docker push mozamimy/salmon:${CIRCLE_TAG:1}'
Expand Down Expand Up @@ -104,12 +98,6 @@ workflows:
ignore: '/.*/'
tags:
only: '/^v\d+\.\d+\.\d+/'
- build_docker_image:
filters:
branches:
ignore: '/.*/'
tags:
only: '/^v\d+\.\d+\.\d+/'
- test:
release: true
requires:
Expand All @@ -118,10 +106,9 @@ workflows:
filters:
tags:
only: '/^v\d+\.\d+\.\d+/'
- push_docker_image:
- build_and_push_docker_image:
requires:
- 'test'
- 'build_docker_image'
filters:
branches:
ignore: '/.*/'
Expand Down

0 comments on commit 2c0d7f0

Please sign in to comment.