-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.woodpecker-debug.yml
More file actions
85 lines (79 loc) · 2.78 KB
/
.woodpecker-debug.yml
File metadata and controls
85 lines (79 loc) · 2.78 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
# ABOUTME: Debug version of Woodpecker CI Pipeline to troubleshoot authentication
# ABOUTME: Tests registry login and provides diagnostic information
clone:
git:
image: woodpeckerci/plugin-git
settings:
recursive: true
lfs: false
when:
event: [push, tag, cron, manual]
steps:
# Step 1: Test secret availability
test-secrets:
image: alpine:latest
environment:
NEXUS_USER:
from_secret: nexus_username
NEXUS_PASS:
from_secret: nexus_password
commands:
- echo "Testing secret availability..."
- echo "NEXUS_USER exists:" $(if [ -n "$NEXUS_USER" ]; then echo "YES"; else echo "NO"; fi)
- echo "NEXUS_USER length:" $(echo -n "$NEXUS_USER" | wc -c)
- echo "NEXUS_PASS exists:" $(if [ -n "$NEXUS_PASS" ]; then echo "YES"; else echo "NO"; fi)
- echo "NEXUS_PASS length:" $(echo -n "$NEXUS_PASS" | wc -c)
when:
event: [push, manual]
# Step 2: Test Docker login manually
test-docker-login:
image: docker:latest
environment:
NEXUS_USER:
from_secret: nexus_username
NEXUS_PASS:
from_secret: nexus_password
commands:
- echo "Testing Docker login to registry..."
- echo "Attempting login with NEXUS_USER..."
- echo "$NEXUS_PASS" | docker login docker-push.acn.fr -u "$NEXUS_USER" --password-stdin && echo "✓ Login successful!" || echo "✗ Login failed"
when:
event: [push, manual]
# Step 3: Simple build without push to test plugin authentication
build-test-plugin:
image: woodpeckerci/plugin-docker-buildx
privileged: true
settings:
dry_run: true # Don't actually push
registry: docker-push.acn.fr
repo: docker-push.acn.fr/openspp/openspp
dockerfile: Dockerfile
platforms: linux/amd64
tags:
- test-${CI_COMMIT_SHA:0:8}
username:
from_secret: nexus_username
password:
from_secret: nexus_password
when:
event: [push, manual]
# Step 4: Alternative authentication method using explicit Docker commands
build-with-explicit-login:
image: docker:latest
privileged: true
environment:
NEXUS_USER:
from_secret: nexus_username
NEXUS_PASS:
from_secret: nexus_password
commands:
- echo "Setting up Docker buildx..."
- docker buildx create --use --name mybuilder || true
- docker buildx inspect --bootstrap
- echo "Logging in to registry with NEXUS_USER..."
- echo "$NEXUS_PASS" | docker login docker-push.acn.fr -u "$NEXUS_USER" --password-stdin
- echo "Building image..."
- docker buildx build --platform linux/amd64 -t docker-push.acn.fr/openspp/openspp:test-manual-${CI_COMMIT_SHA:0:8} -f Dockerfile .
- echo "Build completed (dry run - not pushing)"
when:
event: [push, manual]