Debug woodpecker
This commit is contained in:
parent
d1bf803df2
commit
6256d92ca8
1 changed files with 10 additions and 35 deletions
|
|
@ -2,40 +2,15 @@ when:
|
|||
event: tag
|
||||
|
||||
steps:
|
||||
test-secrets:
|
||||
image: alpine
|
||||
environment:
|
||||
REGISTRY_USERNAME:
|
||||
publish:
|
||||
image: woodpeckerci/plugin-docker-buildx
|
||||
settings:
|
||||
registry: codeberg.org
|
||||
repo: lvl0/incr
|
||||
tags: "${CI_COMMIT_TAG}"
|
||||
dockerfile: docker/Dockerfile
|
||||
context: .
|
||||
username:
|
||||
from_secret: REGISTRY_USERNAME
|
||||
REGISTRY_PASSWORD:
|
||||
password:
|
||||
from_secret: REGISTRY_PASSWORD
|
||||
commands:
|
||||
- echo "Testing secrets..."
|
||||
- test -n "$REGISTRY_USERNAME" || (echo "USERNAME IS EMPTY" && exit 1)
|
||||
- test -n "$REGISTRY_PASSWORD" || (echo "PASSWORD IS EMPTY" && exit 1)
|
||||
- echo "Secrets OK"
|
||||
|
||||
build:
|
||||
image: docker
|
||||
environment:
|
||||
DOCKER_BUILDKIT: "1"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
commands:
|
||||
- echo "⚙️ Building Docker image for ${CI_COMMIT_TAG}"
|
||||
- docker build -f docker/Dockerfile -t codeberg.org/${CI_REPO}:${CI_COMMIT_TAG} .
|
||||
|
||||
push:
|
||||
image: docker
|
||||
environment:
|
||||
REGISTRY_USERNAME:
|
||||
from_secret: REGISTRY_USERNAME
|
||||
REGISTRY_PASSWORD:
|
||||
from_secret: REGISTRY_PASSWORD
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
commands:
|
||||
- echo "🔐 Logging into registry"
|
||||
- echo "${REGISTRY_PASSWORD}" | docker login codeberg.org -u "${REGISTRY_USERNAME}" --password-stdin
|
||||
- echo "📤 Pushing image codeberg.org/${CI_REPO}:${CI_COMMIT_TAG}"
|
||||
- docker push codeberg.org/${CI_REPO}:${CI_COMMIT_TAG}
|
||||
|
|
|
|||
Loading…
Reference in a new issue