elk/.woodpecker.yml

17 lines
752 B
YAML

steps:
- name: build docker
image: docker:25-cli
commands:
- apk add git
- REPO=$(echo "$CI_REPO" | tr '[:upper:]' '[:lower:]')
- IFS='.' read -r MAJOR MINOR FIX <<< "$VERSION"
- MAJOR=$(echo ${CI_COMMIT_TAG} | cut -d '.' -f 1 | tr -d 'v')
- MINOR=$(echo ${CI_COMMIT_TAG} | cut -d '.' -2)
- PATCH=$(echo ${CI_COMMIT_TAG} | cut -d '.' -3)
- REGISTRY="dev.cat-enby.club"
- docker buildx build -t $${REGISTRY}/$${REPO}:v$${MAJOR:-0}.$${MINOR:-0}.$${PATCH-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:
- repo: nikurasu:elk-test-ci
- event: tag