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