mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-10-12 02:20:48 -04:00
CI_COMMIT_BRANCH isn't available in merge request pipelines 😭
This commit is contained in:
parent
66ec4ee2a4
commit
3526b996ca
1 changed files with 3 additions and 3 deletions
|
@ -58,14 +58,14 @@ build_cache:
|
|||
- apk update && apk add jq && apk add curl
|
||||
# Determine cache tag based on branch use branch name as tag, sanitize for Docker tag compatibility
|
||||
- |
|
||||
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
|
||||
if [[ "$CI_COMMIT_BRANCH" == null ]]; then
|
||||
CACHE_TAG="$CI_DEFAULT_BRANCH"
|
||||
CACHE_NAME="build-cache"
|
||||
else
|
||||
CACHE_TAG=$(echo "$CI_COMMIT_BRANCH" | sed 's/[^a-zA-Z0-9._-]/-/g')
|
||||
CACHE_NAME="build-cache-branch"
|
||||
CACHE_NAME="build-cache"
|
||||
fi
|
||||
- 'echo "Using cache tag: $CACHE_TAG in repository: $CACHE_NAME"'
|
||||
- 'echo "Using cache tag: $CACHE_TAG in image: $CACHE_NAME"'
|
||||
# Check if cache exists
|
||||
- if ! docker manifest inspect $CI_REGISTRY_IMAGE/$CACHE_NAME:$CACHE_TAG > /dev/null 2>&1; then
|
||||
- CACHE_EPOCH=0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue