Skip to content
Snippets Groups Projects
.gitlab-ci.yml 25.53 KiB
variables:
  BUILD_VERSION: ""
  HOSTALIASES: "./hosts"
  DOCKER_HOST: "unix:///var/run/dind/docker.sock"
  DOCKER_VERSION: "27"
  TESTCONTAINERS_RYUK_DISABLED: "false"
  ALPINE_VERSION: "3.21"
  PYTHON_VERSION: "3.11"
  JAVA_VERSION: "17"
  NODE_VERSION: "18"
  SONARQUBE_VERSION: "10.0"
  BUN_VERSION: "1.1.40"
  DOC_VERSION: "1.7"
  APP_VERSION: "1.7.1"
  CHART_VERSION: "1.7.1"
  SUPPORTED_VERSIONS: "[\"1.7.0\",\"1.7.1\"]"
  CACHE_FALLBACK_KEY: "${CI_DEFAULT_BRANCH}"
  # This will supress any download for dependencies and plugins or upload messages which would clutter the console log.
  # `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
  MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true -Dstyle.color=always"
  # As of Maven 3.3.0 instead of this you may define these options in `.mvn/maven.config` so the same config is used
  # when running from the command line.
  # `installAtEnd` and `deployAtEnd` are only effective with recent version of the corresponding plugins.
  MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"

image: debian:12-slim

# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
    - .m2/repository

workflow:
  rules:
    - if: $CI_COMMIT_REF_NAME == "dev"
      variables:
        BUILD_VERSION: "-dev.git.${CI_COMMIT_SHORT_SHA}"
    - when: always

stages:
  - lint
  - build
  - test
  - docs
  - clean
  - release
  - verify
  - scan

lint-docker-compose:
  image: docker.io/alpine:${ALPINE_VERSION}
  stage: lint
  variables:
    VERSION: 4.45.1
    BINARY: yq_linux_amd64
  before_script:
    - 'apk --no-cache add bash wget'
    - 'wget https://github.com/mikefarah/yq/releases/download/v${VERSION}/${BINARY} -O /usr/bin/yq && chmod +x /usr/bin/yq'
  script:
    - "bash .scripts/check-compose.sh"
    - "diff <(yq '.volumes' docker-compose.yml) <(yq '.volumes' .docker/docker-compose.yml)"
    - "IGNORE_IMAGE=1 IGNORE_PORTS=1 bash .scripts/check-service.sh 'dbrepo-analyse-service'"
    - "IGNORE_PORTS=1 bash .scripts/check-service.sh 'dbrepo-auth-db'"
    - "IGNORE_IMAGE=1 IGNORE_PORTS=1 bash .scripts/check-service.sh 'dbrepo-auth-service'"
    - "IGNORE_VOLUMES=1 IGNORE_IMAGE=1 bash .scripts/check-service.sh 'dbrepo-auth-service-init'"
    - "IGNORE_IMAGE=1 IGNORE_PORTS=1 bash .scripts/check-service.sh 'dbrepo-broker-service'"
    - "IGNORE_PORTS=1 bash .scripts/check-service.sh 'dbrepo-dashboard-service'"
    - "bash .scripts/check-service.sh 'dbrepo-data-db'"