summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-03-30 11:02:56 +0200
committerThomas Haller <thaller@redhat.com>2022-03-30 11:25:08 +0200
commit11e8b3375f1068bc7c9111144d76862d069f592c (patch)
treed2cd9927ad8c61886b5b3cbfd0e389b0dbb75083
parent318776c56ddc2e83594d4c298b04d5215ae6ae29 (diff)
downloadNetworkManager-11e8b3375f1068bc7c9111144d76862d069f592c.tar.gz
gitlab-ci: fix archiving build log
During the test, we `tee` the output to a log file in "/tmp". We do that, because the test script cleans the working directory several times, so the file cannot reside there. Afterwards, we need to move the file back into the git-tree, so that gitlab can archive it. Previously that was done by "after_script", but the "after_script" may not see the same "/tmp" as the test run ([1]). This needs to be done as part of the "script" step. [1] https://docs.gitlab.com/ee/ci/yaml/#after_script
-rw-r--r--.gitlab-ci.yml15
-rw-r--r--.gitlab-ci/ci.template5
2 files changed, 11 insertions, 9 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9d6c942f09..f174141494 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -47,11 +47,11 @@ variables:
#
# This is done by running `ci-fairy generate-template` and possibly bump
# ".default_tag".
- FEDORA_TAG: '2022-03-15.0-fe6b35cace78'
- UBUNTU_TAG: '2022-03-15.0-ad509d98bfc2'
- DEBIAN_TAG: '2022-03-15.0-ad509d98bfc2'
- CENTOS_TAG: '2022-03-15.0-fe6b35cace78'
- ALPINE_TAG: '2022-03-15.0-913fc0767f1d'
+ FEDORA_TAG: '2022-03-15.0-a017895d3124'
+ UBUNTU_TAG: '2022-03-15.0-0d592fa70bc5'
+ DEBIAN_TAG: '2022-03-15.0-0d592fa70bc5'
+ CENTOS_TAG: '2022-03-15.0-a017895d3124'
+ ALPINE_TAG: '2022-03-15.0-65bef47ff3ce'
FEDORA_EXEC: 'bash .gitlab-ci/fedora-install.sh'
UBUNTU_EXEC: 'bash .gitlab-ci/debian-install.sh'
@@ -626,9 +626,10 @@ alpine:latest@container-clean:
stage: test
script:
- env
- - .gitlab-ci/run-test.sh 2>&1 | tee /tmp/nm-test.log
- after_script:
+ - r=0
+ - .gitlab-ci/run-test.sh 2>&1 | tee /tmp/nm-test.log || r=$?
- mv /tmp/nm-test.log .
+ - exit $r
dependencies: []
diff --git a/.gitlab-ci/ci.template b/.gitlab-ci/ci.template
index 092fffcdaa..e85752e839 100644
--- a/.gitlab-ci/ci.template
+++ b/.gitlab-ci/ci.template
@@ -148,9 +148,10 @@ variables:
stage: test
script:
- env
- - .gitlab-ci/run-test.sh 2>&1 | tee /tmp/nm-test.log
- after_script:
+ - r=0
+ - .gitlab-ci/run-test.sh 2>&1 | tee /tmp/nm-test.log || r=$?
- mv /tmp/nm-test.log .
+ - exit $r
dependencies: []