From 991cb812da343708ad247a82b3e724701486d0fb Mon Sep 17 00:00:00 2001 From: nikurasu Date: Mon, 18 Mar 2024 13:26:08 +0100 Subject: [PATCH] feat(ci): Add build tags --- .woodpecker.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 1099b80b..0b8d85b1 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,10 +1,13 @@ -pipeline: +steps: - name: build docker image: docker:25-cli commands: - apk add git - REPO=$(echo "$CI_REPO" | tr '[:upper:]' '[:lower:]') - - docker buildx build -t dev.cat-enby.club/$${REPO}:$CI_COMMIT_TAG . + - VERSION=${CI_COMMIT_TAG#v} + - IFS='.' read -r MAJOR MINOR FIX <<< "$VERSION" + - REGISTRY="dev.cat-enby.club" + - docker buildx build -t $${REGISTRY}/$${REPO}:v$${MAJOR:-0}.$${MINOR:-0}.$${FIX-0} -t $${REGISTRY}/$${REPO}:v$${MAJOR:-0}.$${MINOR} $${REGISTRY}/$$REPO:v$${MAJOR:-0} $${REGISTRY}/$$REPO:latest . volumes: - /var/run/docker.sock:/var/run/docker.sock when: