variables: MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.showDateTime=true" image: maven:3-eclipse-temurin-8 # Cache downloaded dependencies and plugins between builds. # To keep cache across branches add 'key: "$CI_JOB_NAME"' cache: paths: - .m2/repository key: "$CI_JOB_NAME" stages: - build - docker - package compile:dev: stage: build script: - mvn clean package -Dmaven.test.skip=true except: - tags artifacts: paths: - iparapheur-amp/target/iparapheur-amp*.war expire_in: 1 day compile:tag: stage: build script: - mvn clean package -Dmaven.test.skip=true only: - tags artifacts: paths: - iparapheur-amp/target/iparapheur-amp*.war gitlab_registry: tags: - docker-build stage: docker script: - docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" $CI_REGISTRY - docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME" . - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME" # Create only artifact with docker-compose and conf files packaging: stage: package script: - echo "do packaging" artifacts: paths: - docker-compose.yml - conf