52 lines
1.9 KiB
YAML
52 lines
1.9 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: justme
|
|
ZOT_SECRET:
|
|
from_secret: zot_secret
|
|
ZOT_REGISTRY: registry.oeo.one
|
|
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_SECRET" | buildah login --tls-verify=true --username "$ZOT_USERNAME" --password-stdin "$ZOT_REGISTRY"
|
|
- trap 'buildah logout "$ZOT_REGISTRY" >/dev/null 2>&1 || true' EXIT
|
|
- sha="${CI_COMMIT_SHA:0:7}"
|
|
- build_tag="dev-$sha"
|
|
- image="$ZOT_REGISTRY/justme/webdrop-api:dev-$sha"
|
|
- dev_image="$ZOT_REGISTRY/justme/webdrop-api:dev"
|
|
- build_time="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
|
- buildah bud --layers --network host --format oci --platform linux/amd64 --build-arg "WEBDROP_FRONTEND_COMMIT=$CI_COMMIT_SHA" --build-arg "WEBDROP_FRONTEND_TAG=$build_tag" --build-arg "WEBDROP_BACKEND_COMMIT=$CI_COMMIT_SHA" --build-arg "WEBDROP_BACKEND_TAG=$build_tag" --build-arg "WEBDROP_BUILD_TIME=$build_time" --tag "$image" --file server/Containerfile .
|
|
- buildah tag "$image" "$dev_image"
|
|
- buildah push "$image" "docker://$image"
|
|
- buildah push "$dev_image" "docker://$dev_image"
|