Skip to content

Commit

Permalink
caching for docker layers #75
Browse files Browse the repository at this point in the history
  • Loading branch information
tillias committed Oct 29, 2020
1 parent 142ea01 commit d6c3ddc
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ jobs:
- image: cimg/openjdk:11.0.8-node
steps:
- checkout
command: |
OLD_VERSION=$(mvn -s .circleci/settings.xml -q \
-Dexec.executable="echo" -Dexec.args='${project.version}' \
--non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
NEW_VERSION="${OLD_VERSION/-SNAPSHOT/}"
echo $NEW_VERSION
# Download and cache dependencies
- restore_cache:
Expand Down Expand Up @@ -42,10 +48,7 @@ jobs:
command: 'chmod +x mvnw'
- run:
name: Run Style Checks
command: './mvnw -ntp checkstyle:check'
- run:
name: Clean and Verify
command: './mvnw -ntp clean verify'
command: './mvnw -ntp clean checkstyle:check'
- run:
name: Run Front End Tests
command: npm run test
Expand All @@ -57,21 +60,18 @@ jobs:
command: './mvnw -ntp verify -Pprod -DskipTests'
- when:
condition:
equal: [ dev, << pipeline.git.branch >> ]
equal: [ master, << pipeline.git.branch >> ]
steps:
- setup_remote_docker:
version: 19.03.13
docker_layer_caching: true
- run:
name: Docker push
command: |
docker build -t tillias/microcatalog .
docker tag tillias/microcatalog tillias/microcatalog:$DOCKER_TAG
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker push tillias/microcatalog
- when:
condition:
equal: [ master, << pipeline.git.branch >> ]
steps:
- run:
name: Deploy to Heroku
command: './mvnw -ntp com.heroku.sdk:heroku-maven-plugin:2.0.5:deploy -DskipTests -Pprod -Dheroku.buildpacks=heroku/jvm -Dheroku.appName=microcatalog'
Expand Down

0 comments on commit d6c3ddc

Please sign in to comment.