Skip to content
Snippets Groups Projects
Select Git revision
  • fbfecc5af687e1113ce2758a55a4619abe0063e2
  • master default protected
  • archivematica_cli_version
  • 0.02
4 results

.gitlab-ci.yml

Blame
  • .gitlab-ci.yml 5.22 KiB
    variables:
      EXLIBRIS_SDK_DIR: "/exlibris"
      ROSETTASDK: "${EXLIBRIS_SDK_DIR}/7.3/dps-sdk-projects/dps-sdk-deposit/lib/" # base: https://github.com/ExLibrisGroup/Rosetta.dps-sdk-projects
      JAVARELEASE: "17"
      DOCKERFILE_DEB: "${CI_PROJECT_DIR}/gitlab-ci/Dockerfile_DEB"
      IMAGE_TARGET_DEB: "${CI_REGISTRY_IMAGE}/debian12_${CI_PROJECT_NAME}"
      IMAGE_BASE_DEB: "sdvharbor.slub-dresden.de/replication/debian:bookworm-slim"
      IMAGE_BASE_ULX: "sdvharbor.slub-dresden.de/replication/ubuntu:jammy"
      FF_USE_FASTZIP: "true"
      # These can be specified per job or per pipeline
      ARTIFACT_COMPRESSION_LEVEL: "fast"
      CACHE_COMPRESSION_LEVEL: "fast"
    #  CI_DEBUG_TRACE: "true"
    
    stages:          # List of stages for jobs, and their order of execution
      - build-env
      - test-tool
      - package-tool
      - test-package
    
    default:
      image:
        # use this image for all later stages that happen after the build stage
        name: "${IMAGE_TARGET}:latest"
    
    before_script:    # These steps are run before EACH job.
      - export ROSETTASDK="${ROSETTASDK}"
      - export JAVARELEASE=${JAVARELEASE}
    
    .build-env-job:
      stage: build-env
      timeout: 10m
      tags:
        - "docker"
      image:
        # Use Kaniko base image to build a Docker image to use as the base image for later jobs.
        name: gcr.io/kaniko-project/executor:debug
        entrypoint: [""]
      # Do not run the before_script tasks here, they wouldn't be included in the Docker image. Instead, provide an empty list of tasks.
      before_script: []
      # docu: https://docs.gitlab.com/ee/ci/docker/using_kaniko.html, this is basically copy-pasted from there
      script:
        - mkdir -p /kaniko/.docker
        - echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(printf "%s:%s" "$CI_REGISTRY_USER" "$CI_REGISTRY_PASSWORD" | base64 | tr -d '\n')\"},\"$(printf "%s" "$CI_DEPENDENCY_PROXY_SERVER" | cut -d':' -f1)\":{\"auth\":\"$(printf "%s:%s" "$CI_DEPENDENCY_PROXY_USER" "$CI_DEPENDENCY_PROXY_PASSWORD" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
        # In this task, Kaniko executor is called to build the Image based on the Dockerfile provided with "--dockerfile".
        - echo "CI_PROJECT_DIR=${CI_PROJECT_DIR}"
        - >-
          /kaniko/executor
          --context "${CI_PROJECT_DIR}"
          --dockerfile "${DOCKERFILE}"
          --destination "${IMAGE_TARGET}:latest"
          --build-arg "GITDIR=${CI_PROJECT_DIR}"
          --cache=true
          --cache-repo=${CI_REGISTRY_IMAGE}
          --cache-copy-layers=true
          --snapshotMode=redo
          --use-new-run
          --ignore-var-run
    
    build-debian-env-job:
      extends: .build-env-job
      variables:
        DOCKERFILE: ${DOCKERFILE_DEB}
        IMAGE_TARGET: ${IMAGE_TARGET_DEB}
    
    test-debian-job:
      stage: test-tool
      timeout: 5m
      tags:
        - "docker"