Skip to content

Commit

Permalink
gitlab-ci: set cleanup based on docker for all
Browse files Browse the repository at this point in the history
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
  • Loading branch information
avtikhon committed Jul 15, 2020
1 parent 0ab21ac commit eb09e1e
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions .gitlab-ci.yml
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -93,7 +89,7 @@ variables:

.osx_template: &osx_definition
stage: test
<<: *shell_cleanup_script
<<: *docker_cleanup_script
script:
- ${GITLAB_MAKE} test_osx

Expand All @@ -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

Expand Down Expand Up @@ -216,7 +212,7 @@ perf_bootstrap:
stage: test
tags:
- deploy
<<: *shell_cleanup_script
<<: *docker_cleanup_script
script:
- ${GITLAB_MAKE} perf_prepare
after_script:
Expand Down

0 comments on commit eb09e1e

Please sign in to comment.