Author:
Hash:
Timestamp:
+15 -18 +/-3 browse
Kevin Schoon [me@kevinschoon.com]
0153e16f311e785fc6f7b0029e127d45184907f5
Sun, 25 May 2025 16:02:05 +0000 (5 months ago)
| 1 | diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml |
| 2 | index 1653686..9fdf572 100644 |
| 3 | --- a/.woodpecker/build.yaml |
| 4 | +++ b/.woodpecker/build.yaml |
| 5 | @@ -25,6 +25,9 @@ steps: |
| 6 | - event: [manual, push] |
| 7 | branch: main |
| 8 | image: /bin/sh |
| 9 | + environment: |
| 10 | + AYLLU_REGISTRY: registry.dns.podman:5000 |
| 11 | + AYLLU_SKIP_REGISTRY_LOGIN: "true" |
| 12 | commands: |
| 13 | - scripts/build_container.sh containers/ayllu |
| 14 | - scripts/push_container.sh containers/ayllu |
| 15 | diff --git a/scripts/build_container.sh b/scripts/build_container.sh |
| 16 | index 9202265..3d743e1 100755 |
| 17 | --- a/scripts/build_container.sh |
| 18 | +++ b/scripts/build_container.sh |
| 19 | @@ -6,10 +6,10 @@ set -e |
| 20 | |
| 21 | # The version of Alpine used to build all containers and the runtime |
| 22 | # version used. Ayllu tracks the latest Rust version in stable Alpine. |
| 23 | - ALPINE_BASE_IMAGE="${ALPINE_BASE_IMAGE:-alpine:3.21}" |
| 24 | - CI_BASE_IMAGE="${CI_BASE_IMAGE:-docker.io/woodpeckerci/woodpecker-agent:v3.6.0-alpine}" |
| 25 | + ALPINE_BASE_IMAGE="${AYLLU_ALPINE_BASE_IMAGE:-alpine:3.21}" |
| 26 | + CI_BASE_IMAGE="${AYLLU_CI_BASE_IMAGE:-docker.io/woodpeckerci/woodpecker-agent:v3.6.0-alpine}" |
| 27 | + REGISTRY="${AYLLU_REGISTRY:-registry-auth.ayllu-forge.org}" |
| 28 | |
| 29 | - REGISTRY="registry.ayllu-forge.org" |
| 30 | IMAGE_PATH="ayllu/ayllu" |
| 31 | COMMIT_ID="$(git rev-parse HEAD)" |
| 32 | BRANCH_NAME="$(git branch --show-current)" |
| 33 | diff --git a/scripts/push_container.sh b/scripts/push_container.sh |
| 34 | index 81ef885..6c27343 100755 |
| 35 | --- a/scripts/push_container.sh |
| 36 | +++ b/scripts/push_container.sh |
| 37 | @@ -1,15 +1,11 @@ |
| 38 | #!/bin/sh |
| 39 | - # Push a container image to the authenticated Ayllu registry endpoint. Note |
| 40 | - # that registry.ayllu-forge.org is for enduser consumption without |
| 41 | - # authentication while registry-auth.ayllu-forge.org is used to securely push |
| 42 | - # images into the registry and requries credentials. |
| 43 | + # Push a container image to the Ayllu registry endpoint. |
| 44 | # |
| 45 | # Assumes that the image you are pushing has already been built via the |
| 46 | # build_container.sh script. |
| 47 | set -ex |
| 48 | |
| 49 | - REGISTRY="registry.ayllu-forge.org" |
| 50 | - REGISTRY_AUTH="registry-auth.ayllu-forge.org" |
| 51 | + REGISTRY="${AYLLU_REGISTRY:-registry-auth.ayllu-forge.org}" |
| 52 | IMAGE_PATH="ayllu/ayllu" |
| 53 | COMMIT_ID="$(git rev-parse HEAD)" |
| 54 | BRANCH_NAME="$(git branch --show-current)" |
| 55 | @@ -27,17 +23,15 @@ NAME="$(basename "$TARGET_DIR")" |
| 56 | if [ -n "$AYLLU_REGISTRY_PASS" ] ; then |
| 57 | "$AYLLU_REGISTRY_PASS" | podman --verbose login $REGISTRY_AUTH |
| 58 | else |
| 59 | - podman login $REGISTRY_AUTH |
| 60 | + if [ ! -z "$AYLLU_SKIP_REGISTRY_LOGIN" ] ; then |
| 61 | + podman login $REGISTRY |
| 62 | + fi |
| 63 | fi |
| 64 | |
| 65 | if [ "$NAME" = "ayllu" ] ; then |
| 66 | - podman tag "$REGISTRY/$IMAGE_PATH:$COMMIT_ID" "$REGISTRY_AUTH/$IMAGE_PATH:$COMMIT_ID" |
| 67 | - podman push "$REGISTRY_AUTH/$IMAGE_PATH:$COMMIT_ID" |
| 68 | - podman tag "$REGISTRY/$IMAGE_PATH:$BRANCH_NAME" "$REGISTRY_AUTH/$IMAGE_PATH:$BRANCH_NAME" |
| 69 | - podman push "$REGISTRY_AUTH/$IMAGE_PATH:$BRANCH_NAME" |
| 70 | + podman push "$REGISTRY/$IMAGE_PATH:$COMMIT_ID" |
| 71 | + podman push "$REGISTRY/$IMAGE_PATH:$BRANCH_NAME" |
| 72 | else |
| 73 | - podman tag "$REGISTRY/$IMAGE_PATH:$NAME-$COMMIT_ID" "$REGISTRY_AUTH/$IMAGE_PATH:$NAME-$COMMIT_ID" |
| 74 | - podman push "$REGISTRY_AUTH/$IMAGE_PATH:$NAME-$COMMIT_ID" |
| 75 | - podman tag "$REGISTRY/$IMAGE_PATH:$NAME-$BRANCH_NAME" "$REGISTRY_AUTH/$IMAGE_PATH:$NAME-$BRANCH_NAME" |
| 76 | - podman push "$REGISTRY_AUTH/$IMAGE_PATH:$NAME-$BRANCH_NAME" |
| 77 | + podman push "$REGISTRY/$IMAGE_PATH:$NAME-$COMMIT_ID" |
| 78 | + podman push "$REGISTRY/$IMAGE_PATH:$NAME-$BRANCH_NAME" |
| 79 | fi |