Skip to content
Snippets Groups Projects
Commit 21b37681 authored by Bartek Wrona's avatar Bartek Wrona
Browse files

docker build specific job templates should define git safe directory

parent e74d7109
No related branches found
No related tags found
1 merge request!65Docker building job templates cleanup
...@@ -6,7 +6,8 @@ variables: ...@@ -6,7 +6,8 @@ variables:
include: include:
- local: templates/base.gitlab-ci.yml - local: templates/base.gitlab-ci.yml
.docker_image_builder_job_template: # this version does not call git since it is not present in the pure dind image
.pure_docker_image_builder_job_template:
extends: .job-defaults extends: .job-defaults
variables: variables:
DOCKER_DRIVER: overlay2 DOCKER_DRIVER: overlay2
...@@ -22,6 +23,15 @@ include: ...@@ -22,6 +23,15 @@ include:
- name: registry.gitlab.syncad.com/hive/common-ci-configuration/docker-dind:${DOCKER_DIND_TAG} - name: registry.gitlab.syncad.com/hive/common-ci-configuration/docker-dind:${DOCKER_DIND_TAG}
alias: docker alias: docker
.docker_image_builder_job_template:
extends: .pure_docker_image_builder_job_template
before_script:
- !reference [.pure_docker_image_builder_job_template, before_script]
- |
echo -e "\e[0Ksection_start:$(date +%s):git[collapsed=true]\r\e[0KDisabling Git directory permission check"
git config --global --add safe.directory '*'
echo -e "\e[0Ksection_end:$(date +%s):git\r\e[0K"
.docker_image_cleanup_job_template: .docker_image_cleanup_job_template:
extends: .job-defaults extends: .job-defaults
image: registry.gitlab.syncad.com/hive/common-ci-configuration/python-scripts:${IMAGE_REMOVER_TAG} image: registry.gitlab.syncad.com/hive/common-ci-configuration/python-scripts:${IMAGE_REMOVER_TAG}
...@@ -57,12 +67,6 @@ include: ...@@ -57,12 +67,6 @@ include:
variables: variables:
DOCKER_HUB_USER: $DOCKER_HUB_USER DOCKER_HUB_USER: $DOCKER_HUB_USER
DOCKER_HUB_PASSWORD: $DOCKER_HUB_PASSWORD DOCKER_HUB_PASSWORD: $DOCKER_HUB_PASSWORD
before_script:
- !reference [.docker_image_builder_job_template, before_script]
- |
echo -e "\e[0Ksection_start:$(date +%s):git[collapsed=true]\r\e[0KDisabling Git directory permission check"
git config --global --add safe.directory '*'
echo -e "\e[0Ksection_end:$(date +%s):git\r\e[0K"
rules: rules:
- if: '$CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"' - if: '$CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"'
when: on_success when: on_success
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment