rewrite woodpecker v6
This commit is contained in:
parent
7c170b0ff7
commit
ffe2ec7072
@ -10,28 +10,28 @@ clone:
|
||||
depth: 50
|
||||
|
||||
steps:
|
||||
# ─── build & push ──────────────────────────────────────────
|
||||
# ── Build & push images ──────────────────────────────
|
||||
- name: build-and-push
|
||||
image: docker:24.0-cli # only the CLI, we re‑use host docker
|
||||
image: docker:24.0-cli # use host Docker
|
||||
privileged: true
|
||||
volumes:
|
||||
- name: docker-sock # mount declared at bottom
|
||||
- name: docker-sock # mount declared below
|
||||
path: /var/run/docker.sock
|
||||
commands:
|
||||
- |
|
||||
set -e
|
||||
set -eu
|
||||
REG=us-central1-docker.pkg.dev/aptivaai-dev/aptiva-repo
|
||||
TAG=$(echo "$CI_COMMIT_SHA" | head -c 8)
|
||||
docker buildx create --use --name woodpecker || true
|
||||
for svc in server1 server2 server3 nginx ; do
|
||||
for svc in server1 server2 server3 nginx; do
|
||||
docker buildx build -f Dockerfile.${svc} \
|
||||
-t ${REG}/${svc}:${TAG} --push .
|
||||
done
|
||||
when:
|
||||
event: [push, manual]
|
||||
event: [push, manual]
|
||||
branch: [master]
|
||||
|
||||
# ─── deploy staging ────────────────────────────────────────
|
||||
# ── Deploy to staging ───────────────────────────────
|
||||
- name: deploy-staging
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
@ -49,10 +49,9 @@ steps:
|
||||
- IMG_TAG=$TAG docker compose pull
|
||||
- IMG_TAG=$TAG docker compose up -d --remove-orphans
|
||||
when:
|
||||
event: [push, manual]
|
||||
event: [push, manual]
|
||||
branch: [master]
|
||||
|
||||
# ─── global volume declaration (list **not** indented) ─────
|
||||
volumes:
|
||||
- name: docker-sock
|
||||
host:
|
||||
|
Loading…
Reference in New Issue
Block a user