Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build docker image and push from circle-ci #76 #78

Merged
merged 11 commits into from
Oct 29, 2020
18 changes: 13 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,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 @@ -55,11 +52,22 @@ jobs:
- run:
name: Verify with Prod Profile
command: './mvnw -ntp verify -Pprod -DskipTests'

- when:
condition:
equal: [ master, << pipeline.git.branch >> ]
steps:
- setup_remote_docker:
version: 19.03.13
docker_layer_caching: true
- run:
name: Docker push
command: |
SNAPSHOT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
DOCKER_TAG="${OLD_VERSION/-SNAPSHOT/}"
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
- 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