mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-04-22 09:26:39 +00:00
c2bde44da0
Add HARBOR_USER/HARBOR_TOKEN from Woodpecker secrets and a docker login step before the existing build/push, so pipelines can push to the new TLS-authenticated Harbor registry.
32 lines
1.1 KiB
YAML
32 lines
1.1 KiB
YAML
when:
|
|
event: [push, manual]
|
|
branch: [dev, stage, main]
|
|
|
|
labels:
|
|
platform: arm64
|
|
|
|
steps:
|
|
- name: build-push
|
|
image: docker
|
|
environment:
|
|
REGISTRY_HOST:
|
|
from_secret: registry_host
|
|
HARBOR_USER:
|
|
from_secret: harbor_user
|
|
HARBOR_TOKEN:
|
|
from_secret: harbor_token
|
|
commands:
|
|
- echo "$HARBOR_TOKEN" | docker login "$REGISTRY_HOST" -u "$HARBOR_USER" --password-stdin
|
|
- if [ "$CI_COMMIT_BRANCH" = "main" ]; then export TAG=arm; else export TAG=${CI_COMMIT_BRANCH}-arm; fi
|
|
- export BUILD_DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
- |
|
|
docker build -f SatelliteProvider.Api/Dockerfile \
|
|
--build-arg CI_COMMIT_SHA=$CI_COMMIT_SHA \
|
|
--label org.opencontainers.image.revision=$CI_COMMIT_SHA \
|
|
--label org.opencontainers.image.created=$BUILD_DATE \
|
|
--label org.opencontainers.image.source=$CI_REPO_URL \
|
|
-t $REGISTRY_HOST/satellite-provider:$TAG .
|
|
- docker push $REGISTRY_HOST/satellite-provider:$TAG
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|