[Tarantool-patches] [PATCH v1] gitlab-ci: set cleanup based on docker for all

Alexander V. Tikhonov avtikhon at tarantool.org
Thu Jul 16 13:11:50 MSK 2020


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
---

Github: https://github.com/tarantool/tarantool/tree/avtikhon/cleanup_gitlab-perf
Issue: https://github.com/tarantool/tarantool/issues/5036

 .gitlab-ci.yml | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ba88a26a9..1e6904eb6 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}"
+    - /bin/bash -c "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:
-- 
2.17.1



More information about the Tarantool-patches mailing list