Created
November 5, 2019 17:10
-
-
Save stefanotroia/2d5dee49ea7de8cfb6738837c4aa5ce6 to your computer and use it in GitHub Desktop.
Build Docker images with Maven in Gitlab CI/CD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: docker:latest | |
services: | |
- docker:dind | |
variables: | |
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository" | |
DOCKER_DRIVER: overlay | |
SPRING_PROFILES_ACTIVE: gitlab-ci | |
cache: | |
key: ${CI_COMMIT_REF_SLUG} | |
paths: | |
- .m2/repository | |
stages: | |
- build | |
- deploy | |
maven-build: | |
image: maven:3-jdk-8 | |
stage: build | |
script: | |
- mvn install jib:build -Djib.to.auth.username=$DOCKER_USER -Djib.to.auth.password=$DOCKER_PASSWORD | |
only: | |
- development | |
- staging |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment