diff options
| author | Pietro Albini <pietro@pietroalbini.org> | 2019-10-30 19:41:22 +0100 |
|---|---|---|
| committer | Pietro Albini <pietro@pietroalbini.org> | 2019-10-30 19:41:22 +0100 |
| commit | ca3468768d234af5de4fe7b578b701e3404a6dac (patch) | |
| tree | 57f6d40ad128a058681ec7f696abb3b942ab740a /src/ci/scripts | |
| parent | bdfcde439bcea75d74fe3b181d13332384daf130 (diff) | |
| download | rust-ca3468768d234af5de4fe7b578b701e3404a6dac.tar.gz rust-ca3468768d234af5de4fe7b578b701e3404a6dac.zip | |
ci: move toolstates.json to /tmp/toolstate/ and docker mount it
Before this commit toolstates.json was stored in /tmp and it wasn't mounted outside the build container. That caused uploading the file in the upload-artifacts task to fail, as the file was missing on the host. Mounting /tmp/toolstates.json alone is not the best approach: if the file is missing when the container is started the Docker engine will create a *directory* named /tmp/toolstates.json. The Docker issue could be solved by pre-creating an empty file named /tmp/toolstates.json, but doing that could cause problems if bootstrap fails to generate the file and the toolstate scripts receive an empty JSON. The approach I took in this commit is to instead mount a /tmp/toolstate directory inside Docker, and create the toolstates.json file in it. That also required a small bootstrap change to ensure the directory is created if it's missing.
Diffstat (limited to 'src/ci/scripts')
| -rwxr-xr-x | src/ci/scripts/upload-artifacts.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ci/scripts/upload-artifacts.sh b/src/ci/scripts/upload-artifacts.sh index 625cf378a9b..312ec9d8050 100755 --- a/src/ci/scripts/upload-artifacts.sh +++ b/src/ci/scripts/upload-artifacts.sh @@ -25,7 +25,7 @@ cp cpu-usage.csv "${upload_dir}/cpu-${CI_JOB_NAME}.csv" # Toolstate data. if [[ -n "${DEPLOY_TOOLSTATES_JSON+x}" ]]; then - cp /tmp/toolstates.json "${upload_dir}/${DEPLOY_TOOLSTATES_JSON}" + cp /tmp/toolstate/toolstates.json "${upload_dir}/${DEPLOY_TOOLSTATES_JSON}" fi echo "Files that will be uploaded:" |
