Skip to content
Snippets Groups Projects
Commit 3885999b authored by Дмитрий Кибирев's avatar Дмитрий Кибирев Committed by Yaroslav Dynnikov
Browse files

ci: repair error "fatal: ambiguous argument" close #470

parent b23b0dd1
No related branches found
No related tags found
1 merge request!816ci: repair git error "fatal: ambiguous argument"
Pipeline #30363 passed
...@@ -125,6 +125,8 @@ build-base-image: ...@@ -125,6 +125,8 @@ build-base-image:
# Gitlab CI caching is shit. So we implement it manually # Gitlab CI caching is shit. So we implement it manually
- | - |
# Restore cache # Restore cache
git fetch origin master:refs/remotes/origin/master
git branch -a
if [[ -n "$NO_CACHE" ]]; then if [[ -n "$NO_CACHE" ]]; then
echo "Skipping restoring from cache because NO_CACHE is set" echo "Skipping restoring from cache because NO_CACHE is set"
elif [ "$CI_COMMIT_BRANCH" == "$MAIN_BRANCH" ]; then elif [ "$CI_COMMIT_BRANCH" == "$MAIN_BRANCH" ]; then
...@@ -140,6 +142,21 @@ build-base-image: ...@@ -140,6 +142,21 @@ build-base-image:
else else
echo "No cache found" echo "No cache found"
fi fi
after_script:
- |
# Save cache
if [ "$CI_COMMIT_BRANCH" == "$MAIN_BRANCH" ]; then
ci-log-section start "save-cache" Saving cache to ${CACHE_ARCHIVE} ...
du -sh ${CACHE_PATHS} || true
TMPEXT=$RANDOM
tar -cf "${CACHE_ARCHIVE}.${TMPEXT}" ${CACHE_PATHS}
mv -f "${CACHE_ARCHIVE}.${TMPEXT}" "${CACHE_ARCHIVE}"
echo Ok
du -sh ${CACHE_ARCHIVE}
ci-log-section end "save-cache"
else
echo "Skip saving cache on a non-master branch"
fi
test-linux: test-linux:
extends: .test extends: .test
...@@ -204,20 +221,6 @@ test-linux: ...@@ -204,20 +221,6 @@ test-linux:
--junitxml=junit_pytest.xml --junitxml=junit_pytest.xml
--with-webui --with-webui
- |
# Save cache
if [ "$CI_COMMIT_BRANCH" == "$MAIN_BRANCH" ]; then
ci-log-section start "save-cache" Saving cache to ${CACHE_ARCHIVE} ...
du -sh ${CACHE_PATHS} || true
TMPEXT=$RANDOM
tar -cf "${CACHE_ARCHIVE}.${TMPEXT}" ${CACHE_PATHS}
mv -f "${CACHE_ARCHIVE}.${TMPEXT}" "${CACHE_ARCHIVE}"
echo Ok
du -sh ${CACHE_ARCHIVE}
ci-log-section end "save-cache"
else
echo "Skip saving cache on a non-master branch"
fi
artifacts: artifacts:
when: always when: always
paths: paths:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment