-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.woodpecker.yaml
More file actions
75 lines (73 loc) · 2.23 KB
/
.woodpecker.yaml
File metadata and controls
75 lines (73 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
steps:
# --- Podman variant (runs on agents with podman backend/label) ---
- name: podman-login
when:
event:
- push
- tag
# If your Woodpecker agents are labeled, uncomment and adjust:
# instance:
# labels:
# backend: podman
image: quay.io/podman/stable
privileged: true
environment:
PACKAGER_TOKEN:
from_secret: PACKAGER_TOKEN
commands:
- sh -lc 'OWNER="${CI_REPO%%/*}"; echo "$PACKAGER_TOKEN" | podman login codeberg.org -u "$OWNER" --password-stdin'
- name: podman-build-and-push
when:
event:
- push
- tag
# instance:
# labels:
# backend: podman
image: quay.io/podman/stable
privileged: true
environment:
PACKAGER_TOKEN:
from_secret: PACKAGER_TOKEN
commands:
- |
sh -lc '
set -e
OWNER="${CI_REPO%%/*}"
echo "$PACKAGER_TOKEN" | podman login codeberg.org -u "$OWNER" --password-stdin
IMAGE_REPO="codeberg.org/$CI_REPO"
if [ -n "$CI_COMMIT_TAG" ]; then IMAGE_TAG="$CI_COMMIT_TAG"; else IMAGE_TAG=$(printf "$CI_COMMIT_SHA" | cut -c1-7); fi
echo "CI_REPO=$CI_REPO"
echo "CI_COMMIT_SHA=$CI_COMMIT_SHA"
echo "CI_COMMIT_TAG=$CI_COMMIT_TAG"
echo "Resolved IMAGE_REPO=$IMAGE_REPO"
echo "Resolved IMAGE_TAG=$IMAGE_TAG"
echo "Building $IMAGE_REPO:$IMAGE_TAG (linux/amd64) via Podman"
podman build -t "$IMAGE_REPO:$IMAGE_TAG" -t "$IMAGE_REPO:latest" -f Dockerfile .
podman push "$IMAGE_REPO:$IMAGE_TAG"
podman push "$IMAGE_REPO:latest"
'
- name: mail
when:
event:
- push
- tag
image: deblan/woodpecker-email
settings:
dsn:
from_secret: smtp_dsn
from:
address:
from_secret: smtp_from
name: "Woodpecker"
recipients:
from_secret: smtp_recipients
recipients_only: false
content:
subject: "[{{ pipeline.status }}] {{ repo.full_name }} ({{ commit.branch }} - {{ commit.sha[0:8] }}"
body: |
{{ commit.sha }}<br>
{{ pipeline.status }}<br>
{{ commit.author_email }}<br>
attachments:
- log/*