This commit is contained in:
parent
5e2fc7f87b
commit
3fde58c143
1 changed files with 22 additions and 0 deletions
22
.woodpecker.yml
Normal file
22
.woodpecker.yml
Normal file
|
@ -0,0 +1,22 @@
|
|||
steps:
|
||||
- name: build docker
|
||||
image: docker:25-cli
|
||||
secrets: [user, pass]
|
||||
commands:
|
||||
- apk add git
|
||||
- REPO=$(echo "$CI_REPO" | tr '[:upper:]' '[:lower:]')
|
||||
- REGISTRY="dev.cat-enby.club"
|
||||
- DOCKERFILE="./dev/docker/images/production/backend/Dockerfile"
|
||||
- MAJOR=$(echo ${CI_COMMIT_TAG} | cut -d '.' -f 1 | tr -d 'v')
|
||||
- MINOR=$(echo ${CI_COMMIT_TAG} | cut -d '.' -f 2)
|
||||
- PATCH=$(echo ${CI_COMMIT_TAG} | cut -d '.' -f 3 | cut -d '-' -f 1)
|
||||
- docker buildx build -t $${REGISTRY}/$${REPO}:v$${MAJOR:-0}.$${MINOR:-0}.$${PATCH-0} -t $${REGISTRY}/$${REPO}:v$${MAJOR:-0}.$${MINOR} -t $${REGISTRY}/$$REPO:v$${MAJOR:-0} -t $${REGISTRY}/$$REPO:latest -f $${DOCKERFILE} .
|
||||
- docker login --username $USER --password $PASS $${REGISTRY}
|
||||
- docker push $${REGISTRY}/$${REPO}:v$${MAJOR:-0}.$${MINOR:-0}.$${PATCH-0}
|
||||
- docker push $${REGISTRY}/$${REPO}:v$${MAJOR:-0}.$${MINOR}
|
||||
- docker push $${REGISTRY}/$${REPO}:v$${MAJOR:-0}
|
||||
- docker push $${REGISTRY}/$${REPO}:latest
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
when:
|
||||
- event: tag
|
Loading…
Reference in a new issue