-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.woodpecker-alt.yml
More file actions
109 lines (98 loc) · 3.42 KB
/
.woodpecker-alt.yml
File metadata and controls
109 lines (98 loc) · 3.42 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# ABOUTME: Alternative Woodpecker CI configuration using manual Docker commands
# ABOUTME: Works around potential plugin authentication issues
clone:
git:
image: woodpeckerci/plugin-git
settings:
recursive: true
lfs: false
when:
event: [push, tag, cron, manual]
branch: [main, master, develop, release/*]
steps:
# Build and push Ubuntu image using Docker directly
build-ubuntu:
image: docker:dind
privileged: true
commands:
# Start Docker daemon
- dockerd-entrypoint.sh &
- sleep 5
# Login to registry
- echo "Logging in to Docker registry..."
- echo "${NEXUS_PASSWORD}" | docker login 172.20.0.26:8082 -u "${NEXUS_USERNAME}" --password-stdin
# Build the image
- echo "Building Ubuntu image..."
- docker build \
--build-arg BUILD_DATE="${CI_BUILD_CREATED}" \
--build-arg VCS_REF="${CI_COMMIT_SHA}" \
--build-arg DEBIAN_FRONTEND=noninteractive \
-f Dockerfile \
-t 172.20.0.26:8082/openspp/openspp:latest \
-t 172.20.0.26:8082/openspp/openspp:${CI_COMMIT_BRANCH} \
-t 172.20.0.26:8082/openspp/openspp:${CI_COMMIT_SHA:0:8} \
.
# Push the images
- echo "Pushing images..."
- docker push 172.20.0.26:8082/openspp/openspp:latest
- docker push 172.20.0.26:8082/openspp/openspp:${CI_COMMIT_BRANCH}
- docker push 172.20.0.26:8082/openspp/openspp:${CI_COMMIT_SHA:0:8}
environment:
NEXUS_USERNAME:
from_secret: nexus_username
NEXUS_PASSWORD:
from_secret: nexus_password
when:
event: [push, tag, cron, manual]
# Build and push Slim image
build-slim:
image: docker:dind
privileged: true
commands:
# Start Docker daemon
- dockerd-entrypoint.sh &
- sleep 5
# Login to registry
- echo "Logging in to Docker registry..."
- echo "${NEXUS_PASSWORD}" | docker login 172.20.0.26:8082 -u "${NEXUS_USERNAME}" --password-stdin
# Build the slim image
- echo "Building Slim image..."
- docker build \
--build-arg BUILD_DATE="${CI_BUILD_CREATED}" \
--build-arg VCS_REF="${CI_COMMIT_SHA}" \
--build-arg DEBIAN_FRONTEND=noninteractive \
-f Dockerfile.slim \
-t 172.20.0.26:8082/openspp/openspp:latest-slim \
-t 172.20.0.26:8082/openspp/openspp:${CI_COMMIT_BRANCH}-slim \
-t 172.20.0.26:8082/openspp/openspp:${CI_COMMIT_SHA:0:8}-slim \
.
# Push the images
- echo "Pushing slim images..."
- docker push 172.20.0.26:8082/openspp/openspp:latest-slim
- docker push 172.20.0.26:8082/openspp/openspp:${CI_COMMIT_BRANCH}-slim
- docker push 172.20.0.26:8082/openspp/openspp:${CI_COMMIT_SHA:0:8}-slim
environment:
NEXUS_USERNAME:
from_secret: nexus_username
NEXUS_PASSWORD:
from_secret: nexus_password
when:
event: [push, tag, cron, manual]
# Notify on completion
notify:
image: plugins/webhook
settings:
urls:
from_secret: webhook_url
method: POST
content_type: application/json
template: '{
"text": "OpenSPP Docker Build ${CI_BUILD_STATUS}",
"build": "${CI_BUILD_NUMBER}",
"branch": "${CI_COMMIT_BRANCH}",
"commit": "${CI_COMMIT_SHA:0:8}"
}'
when:
event: [push, tag, cron, manual]
status: [success, failure]
failure: ignore