From 0b5b6e876ef5f3d0bb33e53fb0832b41e1c5e694 Mon Sep 17 00:00:00 2001 From: jo Date: Wed, 14 Dec 2022 16:35:26 +0100 Subject: [PATCH] ci: use shared variables anchors Part-of: --- .gitlab-ci.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9ca0aa084..3a60e09ed 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,6 +4,13 @@ variables: PIP_CACHE_DIR: $CI_PROJECT_DIR/.cache/pip +.shared_variables: + # Keep the git files permissions during job setup + keep_git_files_permissions: &keep_git_files_permissions + GIT_STRATEGY: clone + GIT_DEPTH: "5" + FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: "true" + workflow: rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" @@ -315,10 +322,7 @@ build_front: stage: build image: node:18-alpine variables: - # Keep the git files attributes during job setup - GIT_STRATEGY: clone - GIT_DEPTH: "5" - FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: "true" + <<: *keep_git_files_permissions before_script: - apk add --no-cache jq bash coreutils python3 - cd front @@ -342,10 +346,7 @@ build_api: stage: build image: bash variables: - # Keep the git files attributes during job setup - GIT_STRATEGY: clone - GIT_DEPTH: "5" - FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: "true" + <<: *keep_git_files_permissions script: - rm -rf api/tests - > @@ -385,6 +386,8 @@ deploy_documentation: matrix: - COMPONENT: ["api", "front"] variables: + <<: *keep_git_files_permissions + IMAGE_NAME: funkwhale/$COMPONENT IMAGE: $IMAGE_NAME:$CI_COMMIT_REF_NAME IMAGE_LATEST: $IMAGE_NAME:latest @@ -393,8 +396,6 @@ deploy_documentation: DOCKER_DRIVER: overlay2 DOCKER_TLS_CERTDIR: "" BUILD_PLATFORMS: linux/amd64,linux/arm64,linux/arm/v7 - - FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: "true" tags: - multiarch services: