mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
Fix Gitlab cache issues (#3160)
* Make parent cache download quiet This spammed logs quite a bit * Add "-p" to "mkdir $CI_PROJECT_DIR/cache-artifact" Otherwise the after_script is silently aborted when the dir already exists. * Extract parent cache artifact in own directory and later delete it Otherwise we end up having "testlogs" (and maybe other stuff) in the project directory, which causes future failures.
This commit is contained in:
parent
e9ed354822
commit
4db91c605b
@ -33,13 +33,17 @@ stages:
|
||||
if [ "$CI_COMMIT_REF_SLUG" != "develop" -a "$CI_COMMIT_TAG" == "" ]; then
|
||||
if [ ! -d $CACHE_DIR/ccache ]; then
|
||||
echo "Downloading cache from develop branch"
|
||||
if wget -O cache-artifact.zip https://gitlab.com/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/-/jobs/artifacts/develop/download?job=$CI_JOB_NAME; then
|
||||
unzip cache-artifact.zip
|
||||
mkdir cache-artifact
|
||||
cd cache-artifact
|
||||
if wget --quiet -O cache-artifact.zip https://gitlab.com/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/-/jobs/artifacts/develop/download?job=$CI_JOB_NAME; then
|
||||
unzip -q cache-artifact.zip
|
||||
rm cache-artifact.zip
|
||||
mv cache-artifact/* $CACHE_DIR/
|
||||
else
|
||||
echo "Failed to download cache"
|
||||
fi
|
||||
cd ..
|
||||
rm -rf cache-artifact
|
||||
else
|
||||
echo "Not touching cache (was initialized from previous build)"
|
||||
fi
|
||||
@ -97,7 +101,7 @@ stages:
|
||||
after_script:
|
||||
# Copy all cache files into cache-artifact so that they get uploaded. We only do this for develop so that artifacts
|
||||
# stay minimal for PRs and branches (we never need them)
|
||||
- mkdir $CI_PROJECT_DIR/cache-artifact
|
||||
- mkdir -p $CI_PROJECT_DIR/cache-artifact
|
||||
- mkdir -p $CI_PROJECT_DIR/testlogs
|
||||
- |
|
||||
if [ "$CI_COMMIT_REF_SLUG" = "develop" ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user