# Define templates
include:
  - project: 'gazelle/private/gitlab-ci-templates'
    file: 'extends-v2.yaml'
    ref: '1.0.0'

# Define stages
stages:
  - build
  - predeploy
  - deploy
  - test
  - publish
  - release
  - upgrade
  - cleanup

# Define global variables
variables:
  P_MAVEN_IMAGE_TAG: "3.6.3-jdk-11-slim"

compile/unit-test:
  stage: build
  extends:
    - .buildJavaMavenTest



package:
  stage: build
  extends:
    - .buildJavaMavenPackage
  variables:
    P_MAVEN_EXTRA_ARGS: "-DskipTests -DskipITs"
  needs:
    - job: compile/unit-test
      artifacts: true

install-cache-repo:
  stage: publish
  extends:
    - .publishJavaMavenInstall
  variables:
    P_MAVEN_EXTRA_ARGS: "-DskipTests -DskipITs"
  needs:
    - job: package
      artifacts: true

publish-code:
  stage: publish
  extends:
    - .publishJavaMavenDeploy
  needs:
    - job: package
      artifacts: true

release/code:
  stage: release
  extends:
    - .releaseCodeForJava
  when: manual
  variables:
    P_MAVEN_JAVADOC_SKIP: "true"
