This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

ci: also build (but don't push) outside of tags

+20 -5
+20 -5
.gitlab-ci.yml
··· 17 17 EOF 18 18 19 19 20 - deploy: 20 + build: 21 21 extends: .buildkit 22 - stage: deploy 22 + stage: build 23 23 rules: 24 24 - if: $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+/ 25 + variables: 26 + DEPLOY: "true" 27 + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH 28 + variables: 29 + DEPLOY: "false" 25 30 script: 26 - - export TAG=$(echo $CI_COMMIT_TAG | sed 's/^v//') 31 + - | 32 + if [ "$DEPLOY" == "true" ]; then 33 + export TAG=$(echo $CI_COMMIT_TAG | sed 's/^v//') 34 + else 35 + export TAG=latest-$(echo $CI_COMMIT_SHA | cut -c-6) 36 + fi 27 37 - | 28 38 buildctl-daemonless.sh build \ 29 39 --frontend=dockerfile.v0 \ 30 40 --local context=. \ 31 41 --local dockerfile=. \ 32 42 --opt build-arg:TAG=$TAG \ 33 - --output type=image,name=$CI_REGISTRY_IMAGE:v$TAG,push=true 34 - - echo "Successfully built and pushed $CI_REGISTRY_IMAGE:v$TAG" 43 + --output type=image,name=$CI_REGISTRY_IMAGE:v$TAG,push=$DEPLOY 44 + - | 45 + if [ "$DEPLOY" == "true"]; then 46 + echo "Successfully built and pushed $CI_REGISTRY_IMAGE:v$TAG" 47 + else 48 + echo "Successfully built $CI_REGISTRY_IMAGE:v$TAG" 49 + fi