.maven_build:
  extends: .default
  stage: build
  image: maven:3.9.9-ibm-semeru-17-focal
  script:
    - mvn install -s ci_settings.xml
  artifacts:
    paths:
      - target/

.docker_build:
  extends: .default
  stage: build
  image:
    name: gcr.io/kaniko-project/executor:debug
    entrypoint: [""]
  script:
    - /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:$APP_VERSION" --no-push

.angular_build:
  extends: .default
  stage: build
  image: trion/ng-cli:14.2.6
  script:
    - |
      if [ ! -f  "./src/assets/config/theming.scss" ]; then
          cp ./src/assets/config/theming.default.scss ./src/assets/config/theming.scss
      fi
      if [ ! -f  "./src/assets/config/config.prod.json" ]; then
          cp ./src/assets/config/config.prod.default.json ./src/assets/config/config.prod.json
      fi
    - npm install
    - ng build --configuration production --deleteOutputPath=false
  artifacts:
    paths:
      - dist/
