fix(ci): switch to Kaniko image builder using global gitea secrets
This commit is contained in:
@@ -59,40 +59,58 @@ steps:
|
|||||||
- lint
|
- lint
|
||||||
- format
|
- format
|
||||||
|
|
||||||
publish-gateway:
|
build-gateway:
|
||||||
image: woodpeckerci/plugin-docker-buildx
|
image: gcr.io/kaniko-project/executor:debug
|
||||||
settings:
|
environment:
|
||||||
registry: git.mosaicstack.dev
|
REGISTRY_USER:
|
||||||
repo: git.mosaicstack.dev/mosaic/mosaic-stack-gateway
|
from_secret: gitea_username
|
||||||
dockerfile: docker/gateway.Dockerfile
|
REGISTRY_PASS:
|
||||||
tags:
|
from_secret: gitea_password
|
||||||
- latest
|
CI_COMMIT_BRANCH: ${CI_COMMIT_BRANCH}
|
||||||
- ${CI_COMMIT_SHA}
|
CI_COMMIT_TAG: ${CI_COMMIT_TAG}
|
||||||
username:
|
CI_COMMIT_SHA: ${CI_COMMIT_SHA}
|
||||||
from_secret: REGISTRY_USERNAME
|
commands:
|
||||||
password:
|
- mkdir -p /kaniko/.docker
|
||||||
from_secret: REGISTRY_PASSWORD
|
- echo "{\"auths\":{\"git.mosaicstack.dev\":{\"username\":\"$REGISTRY_USER\",\"password\":\"$REGISTRY_PASS\"}}}" > /kaniko/.docker/config.json
|
||||||
|
- |
|
||||||
|
DESTINATIONS="--destination git.mosaicstack.dev/mosaic/mosaic-stack/gateway:sha-${CI_COMMIT_SHA:0:7}"
|
||||||
|
if [ "$CI_COMMIT_BRANCH" = "main" ]; then
|
||||||
|
DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaic/mosaic-stack/gateway:latest"
|
||||||
|
fi
|
||||||
|
if [ -n "$CI_COMMIT_TAG" ]; then
|
||||||
|
DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaic/mosaic-stack/gateway:$CI_COMMIT_TAG"
|
||||||
|
fi
|
||||||
|
/kaniko/executor --context . --dockerfile docker/gateway.Dockerfile $DESTINATIONS
|
||||||
when:
|
when:
|
||||||
- event: push
|
- branch: [main]
|
||||||
branch: main
|
event: [push, manual, tag]
|
||||||
depends_on:
|
depends_on:
|
||||||
- build
|
- build
|
||||||
|
|
||||||
publish-web:
|
build-web:
|
||||||
image: woodpeckerci/plugin-docker-buildx
|
image: gcr.io/kaniko-project/executor:debug
|
||||||
settings:
|
environment:
|
||||||
registry: git.mosaicstack.dev
|
REGISTRY_USER:
|
||||||
repo: git.mosaicstack.dev/mosaic/mosaic-stack-web
|
from_secret: gitea_username
|
||||||
dockerfile: docker/web.Dockerfile
|
REGISTRY_PASS:
|
||||||
tags:
|
from_secret: gitea_password
|
||||||
- latest
|
CI_COMMIT_BRANCH: ${CI_COMMIT_BRANCH}
|
||||||
- ${CI_COMMIT_SHA}
|
CI_COMMIT_TAG: ${CI_COMMIT_TAG}
|
||||||
username:
|
CI_COMMIT_SHA: ${CI_COMMIT_SHA}
|
||||||
from_secret: REGISTRY_USERNAME
|
commands:
|
||||||
password:
|
- mkdir -p /kaniko/.docker
|
||||||
from_secret: REGISTRY_PASSWORD
|
- echo "{\"auths\":{\"git.mosaicstack.dev\":{\"username\":\"$REGISTRY_USER\",\"password\":\"$REGISTRY_PASS\"}}}" > /kaniko/.docker/config.json
|
||||||
|
- |
|
||||||
|
DESTINATIONS="--destination git.mosaicstack.dev/mosaic/mosaic-stack/web:sha-${CI_COMMIT_SHA:0:7}"
|
||||||
|
if [ "$CI_COMMIT_BRANCH" = "main" ]; then
|
||||||
|
DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaic/mosaic-stack/web:latest"
|
||||||
|
fi
|
||||||
|
if [ -n "$CI_COMMIT_TAG" ]; then
|
||||||
|
DESTINATIONS="$DESTINATIONS --destination git.mosaicstack.dev/mosaic/mosaic-stack/web:$CI_COMMIT_TAG"
|
||||||
|
fi
|
||||||
|
/kaniko/executor --context . --dockerfile docker/web.Dockerfile $DESTINATIONS
|
||||||
when:
|
when:
|
||||||
- event: push
|
- branch: [main]
|
||||||
branch: main
|
event: [push, manual, tag]
|
||||||
depends_on:
|
depends_on:
|
||||||
- build
|
- build
|
||||||
|
|||||||
Reference in New Issue
Block a user