Select Git revision
.gitlab-ci.yml
.gitlab-ci.yml 3.58 KiB
stages: # List of stages for jobs, and their order of execution
- build
- pretest
- unittest
- packaging
- secret_detection
variables:
EXTLIB: "/usr/local/perl5/"
PERL5LIB: "$EXTLIB/lib/perl5/:lib"
# Make sure to use only codenames that are supported by SLUB's Debian repo server!
DEBIAN_DEFAULT_RELEASE: "bookworm"
DEBIAN_RELEASE: "${DEBIAN_DEFAULT_RELEASE}"
DEBIAN_RELEASES: "${DEBIAN_DEFAULT_RELEASE}"
IMAGE_TARGET: "${HARBOR_HOST}/${HARBOR_PROJECT}/${DEBIAN_DEFAULT_RELEASE}_${HARBOR_PROJECT}"
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"
CACHEDIR: "${CI_PROJECT_NAME}/${CI_COMMIT_BRANCH}/"
default:
timeout: 30m
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 PERL5LIB
- export PATH="$PATH:$EXTLIB/bin"
- export Log4perl=1
cache:
paths:
- ${CACHEDIR}
#- docker login -u ${HARBOR_USER} -p ${HARBOR_PASSWORD} ${HARBOR_HOST}
#after_script:
#- docker logout
build-env-job: # This job runs in the build stage, which runs first.
stage: build
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 -n "{\"auths\":{\"${HARBOR_HOST}\":{\"auth\":\"$(echo -n ${HARBOR_USERNAME}:${HARBOR_PASSWORD} | base64 -w 0)\"}},\"$(printf "%s" "$CI_DEPENDENCY_PROXY_SERVER" | cut -d':' -f1)\":{\"auth\":\"$( printf "%s:%s" "$CI_DEPENDENCY_PROXY_USER" "$CI_DEPENDENCY_PROXY_PASSWORD" | base64 -w 0 )\"}}}" | tee /kaniko/.docker/config.json
- echo "CI_PROJECT_DIR=${CI_PROJECT_DIR}";
# In this task, Kaniko executor is called to build the Image based on the Dockerfile provided with "--dockerfile".
- >-
/kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/gitlab-ci/Dockerfile"
--destination "${IMAGE_TARGET}:latest"
--build-arg "GITDIR=${CI_PROJECT_DIR}"
--build-arg "DEBIAN_RELEASE"
--cache=true
--cache-repo=${CI_REGISTRY_IMAGE}
--cache-copy-layers=true
--snapshot-mode=redo
--use-new-run
--ignore-var-run
perl-unit-test-job: # This job runs in the test stage.
stage: unittest # It only starts when the job in the build stage completes successfully.