Commit

Author:

Hash:

Timestamp:

+22 -20 +/-3 browse

Kevin Schoon [me@kevinschoon.com]

34518b24ec1a31b004cb986edf3a7afeefed361f

Sat, 24 May 2025 07:10:12 +0000 (5 months ago)

update woodpecker-ci with build support
1diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml
2index f03e21c..383affb 100644
3--- a/.woodpecker/build.yaml
4+++ b/.woodpecker/build.yaml
5 @@ -1,24 +1,32 @@
6+ cargo_env: &cargo_env
7+ CARGO_BUILD_JOBS: 5
8 when:
9- - event: [pull_request, push, manual]
10-
11+ - event: [push, manual]
12 steps:
13 - name: cargo-fmt
14 image: /bin/sh
15- environment:
16- CARGO_BUILD_JOBS: 5
17+ environment: *cargo_env
18 commands:
19 - cargo fmt --check
20 - name: cargo-clippy
21 image: /bin/sh
22- environment:
23- CARGO_BUILD_JOBS: 5
24+ environment: *cargo_env
25 commands:
26 # - scripts/ensure_database.sh
27 - cargo clippy
28 - name: cargo-test
29 image: /bin/sh
30- environment:
31- CARGO_BUILD_JOBS: 5
32+ environment: *cargo_env
33 commands:
34 # - scripts/ensure_database.sh
35 - cargo test
36+ - name: build-container
37+ when:
38+ - event: push
39+ branch: main
40+ image: /bin/sh
41+ commands:
42+ - scripts/build-container containers/ayllu
43+ - scripts/push-container containers/ayllu
44+ - scripts/build-container containers/multiuser
45+ - scripts/push-container containers/multiuser
46 diff --git a/scripts/build_and_deploy.sh b/scripts/build_and_deploy.sh
47deleted file mode 100755
48index 0459f46..0000000
49--- a/scripts/build_and_deploy.sh
50+++ /dev/null
51 @@ -1,11 +0,0 @@
52- #!/bin/sh
53- # Internal helper script to build and deploy Ayllu in one command
54-
55- set -e
56-
57- scripts/build_all_containers.sh
58- scripts/push_all_containers.sh
59-
60- /usr/lib/podman/quadlet --user "$HOME/.config/systemd/user"
61- systemctl --user daemon-reload
62- systemctl --user restart ayllu
63 diff --git a/scripts/push_container.sh b/scripts/push_container.sh
64index 6c42a00..81ef885 100755
65--- a/scripts/push_container.sh
66+++ b/scripts/push_container.sh
67 @@ -23,7 +23,12 @@ TARGET_DIR="$1"
68 [ -z "$TARGET_DIR" ] && usage
69
70 NAME="$(basename "$TARGET_DIR")"
71- podman login "$REGISTRY_AUTH"
72+
73+ if [ -n "$AYLLU_REGISTRY_PASS" ] ; then
74+ "$AYLLU_REGISTRY_PASS" | podman --verbose login $REGISTRY_AUTH
75+ else
76+ podman login $REGISTRY_AUTH
77+ fi
78
79 if [ "$NAME" = "ayllu" ] ; then
80 podman tag "$REGISTRY/$IMAGE_PATH:$COMMIT_ID" "$REGISTRY_AUTH/$IMAGE_PATH:$COMMIT_ID"