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

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

# Define global variables
variables:
  P_NAME: "gazelle-objects-checker"
  P_APP_TYPE: "java"
  P_CODE_SRC_PATH: "."
  P_MAVEN_IMAGE_TAG: "3.6.3-jdk-11-slim"

# Define jobs
compile/unit-test:
  stage: build
  extends:
    - .buildJavaMavenTest
  variables:
    MAVEN_PHASE: "clean install"

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

static-analysis:
  stage: test
  extends:
    - .testJavaMavenSonarAnalysis
  needs:
    - job: compile/unit-test
      artifacts: true
  variables:
    P_MAVEN_EXTRA_ARGS: "-Psonar -DskipTests"


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


release/code:
  stage: release
  extends:
    - .releaseCodeForJava