From 3dcaaf6aa48203e29106bd8335eabae805800671 Mon Sep 17 00:00:00 2001 From: "Alexander V. Tikhonov" Date: Wed, 15 Jul 2020 14:21:49 +0300 Subject: [PATCH] gitlab-ci: set cleanup based on docker for all Set cleanup based on docker for all of the jobs to avoid of fails when the job before change could use docker and reassigned the temporary files in the working directory. If the docker is not available than no need to use it for cleanup and cleanup runs using shell. Follows up #5036 --- .gitlab-ci.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ba88a26a9c59..23fced6b3e2e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,13 +9,9 @@ variables: GIT_CLEAN_COMMAND: "git clean -ffdx && git submodule foreach git clean -ffdx && git submodule foreach git status" GIT_CLEAN_FLAGS: none -.shell_before_script_template: &shell_cleanup_script - before_script: - - /bin/bash -c "${GIT_CLEAN_COMMAND}" - .docker_before_script_template: &docker_cleanup_script before_script: - - docker run -w /source -v ${PWD}:/source -i packpack/packpack:el-7 /bin/bash -c "${GIT_CLEAN_COMMAND}" + - ( docker run -w /source -v ${PWD}:/source -i packpack/packpack:el-7 /bin/bash -c "${GIT_CLEAN_COMMAND}" || ( ${GIT_CLEAN_COMMAND} ) ) # Jobs templates @@ -46,14 +42,14 @@ variables: stage: test tags: - docker_test - <<: *shell_cleanup_script + <<: *docker_cleanup_script .docker_test_clang8_template: &docker_test_clang8_definition image: "${CI_REGISTRY}/${CI_PROJECT_PATH}/testing/debian-buster:latest" stage: test tags: - docker_test - <<: *shell_cleanup_script + <<: *docker_cleanup_script .pack_template: &pack_definition <<: *pack_only_definition @@ -93,7 +89,7 @@ variables: .osx_template: &osx_definition stage: test - <<: *shell_cleanup_script + <<: *docker_cleanup_script script: - ${GITLAB_MAKE} test_osx @@ -114,14 +110,14 @@ variables: paths: - "*_result.txt" - "*_t_version.txt" - <<: *shell_cleanup_script + <<: *docker_cleanup_script script: - ${GITLAB_MAKE} perf_run .perf_cleanup_definition: &perf_cleanup_definition <<: *perf_only_definition stage: cleanup - <<: *shell_cleanup_script + <<: *docker_cleanup_script script: - ${GITLAB_MAKE} perf_cleanup @@ -216,7 +212,7 @@ perf_bootstrap: stage: test tags: - deploy - <<: *shell_cleanup_script + <<: *docker_cleanup_script script: - ${GITLAB_MAKE} perf_prepare after_script: