From d82ab8cd3cd43bf538d93b7a3a0a1ad0faf1032f Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Fri, 28 Nov 2025 12:06:39 +0000 Subject: [PATCH] Migrate back to gitea packages (#5) Reviewed-on: https://gitea.badhouseplants.net/badhouseplants/container-builder/pulls/5 --- .woodpecker.yaml | 5 +++-- Containerfile | 13 +------------ build | 13 ++++++------- scripts/build-container | 2 +- 4 files changed, 11 insertions(+), 22 deletions(-) diff --git a/.woodpecker.yaml b/.woodpecker.yaml index 4c65c2f..6aba927 100644 --- a/.woodpecker.yaml +++ b/.woodpecker.yaml @@ -15,9 +15,10 @@ steps: image: alpine privileged: true environment: - BUILDAH_REG: zot.badhouseplants.net/badhouseplants/badhouseplants-builder + BUILDAH_REG: gitea.badhouseplants.net/badhouseplants/container-builder REGISTRY_TOKEN: - from_secret: registry_token + from_secret: GITEA_REGISTRY_TOKEN + REGISTRY_USER: devops-bot commands: - ./build backend_options: diff --git a/Containerfile b/Containerfile index 1b723b6..294416d 100644 --- a/Containerfile +++ b/Containerfile @@ -1,16 +1,5 @@ -FROM registry.hub.docker.com/rclone/rclone AS rclone -WORKDIR /out -RUN cp $(which rclone) /out/rclone - -FROM registry.hub.docker.com/argoproj/argocd as argocd -WORKDIR /out -RUN cp $(which argocd) /out/argocd - - FROM registry.hub.docker.com/library/alpine -RUN apk update --no-cache&&\ +RUN apk update --no-cache &&\ apk add yq gettext openssl curl jq perl git git-lfs netavark\ buildah cni-plugins iptables ip6tables fuse-overlayfs --no-cache -COPY --from=rclone /out/rclone /usr/bin/rclone -COPY --from=argocd /out/argocd /usr/bin/argocd COPY ./scripts/ /usr/bin/ diff --git a/build b/build index e20381d..ee50a4c 100755 --- a/build +++ b/build @@ -21,19 +21,18 @@ # --------------------------------------------------------------------------- #! /bin/sh -echo "28.03.2025" +echo "28.11.2025" apk update apk add buildah cni-plugins iptables ip6tables fuse-overlayfs netavark -buildah login -u woody -p $REGISTRY_TOKEN zot.badhouseplants.net +buildah login -u $REGISTRY_USER -p $REGISTRY_TOKEN gitea.badhouseplants.net buildah build -t $BUILDAH_REG:$CI_COMMIT_SHA . -buildah tag $BUILDAH_REG:$CI_COMMIT_SHA $BUILDAH_REG:latest if [ -z ${BUILD_DEBUG+x} ]; then - buildah push $BUILDAH_REG:$CI_COMMIT_SHA; - buildah push $BUILDAH_REG:latest; + buildah push $BUILDAH_REG:$CI_COMMIT_SHA; fi -if [ "${CI_REPO_DEFAULT_BRANCH}"="${CI_COMMIT_BRANCH}" ]; then - buildah push $BUILDAH_REG:latest +if [ ${CI_COMMIT_BRANCH} = ${CI_REPO_DEFAULT_BRANCH} ]; then + buildah tag $BUILDAH_REG:$CI_COMMIT_SHA $BUILDAH_REG:latest + buildah push $BUILDAH_REG:latest; fi diff --git a/scripts/build-container b/scripts/build-container index c3f1045..2e8c853 100755 --- a/scripts/build-container +++ b/scripts/build-container @@ -35,7 +35,7 @@ chomp($git_commit_sha); # -- Build the image with SHA tag # -- my main build system is DRONE, so I'm using DRONE variables a lot # --------------------------------------------------------------------------- -my $container_registry = $ENV{'CONTAINER_REGISTRY'} || 'zot.badhouseplants.net'; +my $container_registry = $ENV{'CONTAINER_REGISTRY'} || 'gitea.badhouseplants.net'; my $image_name = $ENV{'PACKAGE_NAME'} | $ENV{'DRONE_REPO'} || "badhouseplants/badhouseplants-net"; my $tag = "$container_registry/$image_name:$git_commit_sha"; my $custom_tag = $ENV{'CUSTOM_TAG'} || "";