Select Git revision
.gitlab-ci.yml
.gitlab-ci.yml 3.33 KiB
# This file is a template, and might need editing before it works on your project.
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml
# This is a sample GitLab CI/CD configuration file that should run without any modifications.
# It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts,
# it uses echo commands to simulate the pipeline execution.
#
# A pipeline is composed of independent jobs that run scripts, grouped into stages.
# Stages run in sequential order, but jobs within stages run in parallel.
#
# For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages
stages: # List of stages for jobs, and their order of execution
- build
- test
- packaging
variables:
EXLIBRIS_SDK_DIR: "/exlibris"
ROSETTASDK: "${EXLIBRIS_SDK_DIR}/7.3/lib/"
IMAGE_TARGET: "$CI_REGISTRY_IMAGE/bullseye_subapp"
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"
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}"
build-env-job: # This job runs in the build stage, which runs first.
stage: build
timeout: 30m
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 "${CI_PROJECT_DIR}/gitlab-ci/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
test-job:
stage: test