51 lines
1.7 KiB
YAML
51 lines
1.7 KiB
YAML
when:
|
|
- event: push
|
|
branch: master
|
|
evaluate: 'CI_COMMIT_MESSAGE contains "[CI]"'
|
|
- event: push
|
|
branch: main
|
|
evaluate: 'CI_COMMIT_MESSAGE contains "[CI]"'
|
|
|
|
labels:
|
|
ci: domain-linux-native
|
|
platform: linux/amd64
|
|
|
|
clone:
|
|
- name: git
|
|
image: woodpeckerci/plugin-git:2.9.3
|
|
settings:
|
|
remote:
|
|
from_secret: gitea_clone_webdrop
|
|
lfs: false
|
|
|
|
depends_on:
|
|
- ci
|
|
- web-build
|
|
|
|
concurrency: 1
|
|
|
|
steps:
|
|
publish-dev-image:
|
|
image: bash
|
|
environment:
|
|
ZOT_USERNAME:
|
|
from_secret: registry_username
|
|
ZOT_PASSWORD:
|
|
from_secret: registry_password
|
|
ZOT_REGISTRY: 192.168.2.162:5000
|
|
commands:
|
|
- set -euo pipefail
|
|
- ': "${WOODPECKER_BACKEND_LOCAL_TEMP_DIR:=$HOME/woodpecker/work}"'
|
|
- buildah_store="$(dirname "$WOODPECKER_BACKEND_LOCAL_TEMP_DIR")/buildah-cache/webdrop"
|
|
- mkdir -p "$buildah_store/storage" "$buildah_store/run"
|
|
- 'buildah() { command buildah --root "$buildah_store/storage" --runroot "$buildah_store/run" "$@"; }'
|
|
- printf '%s' "$ZOT_PASSWORD" | buildah login --tls-verify=false "$ZOT_REGISTRY" --username "$ZOT_USERNAME" --password-stdin
|
|
- trap 'buildah logout "$ZOT_REGISTRY" >/dev/null 2>&1 || true' EXIT
|
|
- sha="${CI_COMMIT_SHA:0:7}"
|
|
- image="$ZOT_REGISTRY/justme/webdrop-api:dev-$sha"
|
|
- dev_image="$ZOT_REGISTRY/justme/webdrop-api:dev"
|
|
- buildah bud --layers --network host --format docker --platform linux/amd64 --tag "$image" --file server/Dockerfile .
|
|
- buildah tag "$image" "$dev_image"
|
|
- buildah push --tls-verify=false "$image" "docker://$image"
|
|
- buildah push --tls-verify=false "$dev_image" "docker://$dev_image"
|