From f1775ea02b0c985e27449fbabeb810cd07e27f53 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Sun, 16 Jul 2023 21:13:02 +0200 Subject: [PATCH 01/15] Add a current date to the build script to rebuild on commits --- build | 1 + 1 file changed, 1 insertion(+) diff --git a/build b/build index 4b3ef34..9d7f0ee 100755 --- a/build +++ b/build @@ -21,6 +21,7 @@ # --------------------------------------------------------------------------- #! /bin/sh +echo "07.16.2023" apk update apk add buildah cni-plugins iptables ip6tables fuse-overlayfs -- 2.49.0 From 2449b73b13a62ae916c6703778d096e5290157b3 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Sun, 6 Aug 2023 20:39:01 +0200 Subject: [PATCH 02/15] Update a date of a build --- build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build b/build index 9d7f0ee..c9cf6e3 100755 --- a/build +++ b/build @@ -21,7 +21,7 @@ # --------------------------------------------------------------------------- #! /bin/sh -echo "07.16.2023" +echo "08.06.2023" apk update apk add buildah cni-plugins iptables ip6tables fuse-overlayfs -- 2.49.0 From eeea22991eb84b3da02aceb8a8ad04524c17f31b Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Fri, 18 Aug 2023 14:21:25 +0200 Subject: [PATCH 03/15] Add additional logic for tagging --- scripts/build-container | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/build-container b/scripts/build-container index 122d469..c457661 100755 --- a/scripts/build-container +++ b/scripts/build-container @@ -36,20 +36,27 @@ chomp($git_commit_sha); # -- my main build system is DRONE, so I'm using DRONE variables a lot # --------------------------------------------------------------------------- my $container_registry = $ENV{'CONTAINER_REGISTRY'} || 'git.badhouseplants.net'; -my $image_name = $ENV{'DRONE_REPO'} || "badhouseplants/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"} || ""; my $username = $ENV{'DRONE_USERNAME'} || "allanger"; my $password = $ENV{'GITEA_TOKEN'} || "YOU NOT AUTHORIZED, PAL"; +my $containerfile = $ENV{'CONTAINERFILE'} || "."; 0 == system ("buildah login --username $username --password $password $container_registry") or die $!; -0 == system ("buildah build -t $tag .") or die $!; +0 == system ("buildah bud -t $tag $containerfile") or die $!; 0 == system ("buildah push $tag") or die $!; # --------------------------------------------------------------------------- # -- Push the latest if the branch is main # --------------------------------------------------------------------------- if ( $git_branch eq $main_branch) { my $latest_tag = "$container_registry/$image_name:latest"; - 0 == system ("buildah tag $tag $latest_tag") or die $!; + 0 == system ("buildah tag $tag $latest_tag") or die $!; 0 == system ("buildah push $latest_tag") or die $!; } +if ( $custom_tag ne "" ) { + my $custom_tag_final = "$container_registry/$image_name:$custom_tag"; + 0 == system ("buildah tag $tag $custom_tag_final") or die $!; + 0 == system ("buildah push $custom_tag_final") or die $!; +} print "Thanks!\n"; -- 2.49.0 From 48c5487d4593e5832cd141a7512047f52607257b Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Fri, 18 Aug 2023 14:57:06 +0200 Subject: [PATCH 04/15] Fix env vars parsing --- scripts/build-container | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build-container b/scripts/build-container index c457661..cda5d4f 100755 --- a/scripts/build-container +++ b/scripts/build-container @@ -36,9 +36,9 @@ chomp($git_commit_sha); # -- my main build system is DRONE, so I'm using DRONE variables a lot # --------------------------------------------------------------------------- my $container_registry = $ENV{'CONTAINER_REGISTRY'} || 'git.badhouseplants.net'; -my $image_name = $ENV{"PACKAGE_NAME"} | $ENV{'DRONE_REPO'} || "badhouseplants/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"} || ""; +my $custom_tag = $ENV{'CUSTOM_TAG'} || ""; my $username = $ENV{'DRONE_USERNAME'} || "allanger"; my $password = $ENV{'GITEA_TOKEN'} || "YOU NOT AUTHORIZED, PAL"; my $containerfile = $ENV{'CONTAINERFILE'} || "."; -- 2.49.0 From 555262114ea81f6f286010474527f419b56d33a3 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Fri, 18 Aug 2023 15:25:50 +0200 Subject: [PATCH 05/15] Fix containerfile paht --- scripts/build-container | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build-container b/scripts/build-container index cda5d4f..9cfe961 100755 --- a/scripts/build-container +++ b/scripts/build-container @@ -41,9 +41,9 @@ my $tag = "$container_registry/$image_name:$git_commit_sha"; my $custom_tag = $ENV{'CUSTOM_TAG'} || ""; my $username = $ENV{'DRONE_USERNAME'} || "allanger"; my $password = $ENV{'GITEA_TOKEN'} || "YOU NOT AUTHORIZED, PAL"; -my $containerfile = $ENV{'CONTAINERFILE'} || "."; +my $containerfile = $ENV{'CONTAINERFILE'} || "Containerfile"; 0 == system ("buildah login --username $username --password $password $container_registry") or die $!; -0 == system ("buildah bud -t $tag $containerfile") or die $!; +0 == system ("buildah bud -t $tag -f $containerfile .") or die $!; 0 == system ("buildah push $tag") or die $!; # --------------------------------------------------------------------------- # -- Push the latest if the branch is main -- 2.49.0 From 9fabf0ce6eab3a9a9da15b2791e8282afc05ee0b Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Sun, 4 Feb 2024 09:06:38 +0100 Subject: [PATCH 06/15] Build to refresh packages --- build | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build b/build index c9cf6e3..0396413 100755 --- a/build +++ b/build @@ -6,13 +6,13 @@ # -- software and its documentation for any purpose, provided that the # -- above copyright notice and the following two paragraphs appear in # -- all copies of this software. -# -- +# -- # -- IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR # -- DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES # -- ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN # -- IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH # -- DAMAGE. -# -- +# -- # -- THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, # -- BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND # -- FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS @@ -21,7 +21,7 @@ # --------------------------------------------------------------------------- #! /bin/sh -echo "08.06.2023" +echo "02.04.2024" apk update apk add buildah cni-plugins iptables ip6tables fuse-overlayfs @@ -29,6 +29,6 @@ buildah login -u allanger -p $GITEA_TOKEN git.badhouseplants.net buildah build -t $BUILDAH_REG:$DRONE_COMMIT_SHA . buildah tag $BUILDAH_REG:$DRONE_COMMIT_SHA $BUILDAH_REG:latest if [ -z ${BUILD_DEBUG+x} ]; then - buildah push $BUILDAH_REG:$DRONE_COMMIT_SHA; - buildah push $BUILDAH_REG:latest; + buildah push $BUILDAH_REG:$DRONE_COMMIT_SHA; + buildah push $BUILDAH_REG:latest; fi -- 2.49.0 From ff4a98f2acb557ad443f279627036bebf06bc4f1 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Tue, 27 Feb 2024 16:35:31 +0100 Subject: [PATCH 07/15] Add build args support --- scripts/build-container | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/build-container b/scripts/build-container index 9cfe961..b7a6e70 100755 --- a/scripts/build-container +++ b/scripts/build-container @@ -42,8 +42,9 @@ my $custom_tag = $ENV{'CUSTOM_TAG'} || ""; my $username = $ENV{'DRONE_USERNAME'} || "allanger"; my $password = $ENV{'GITEA_TOKEN'} || "YOU NOT AUTHORIZED, PAL"; my $containerfile = $ENV{'CONTAINERFILE'} || "Containerfile"; +my $args = $ENV{'BUILD_ARGS'}; 0 == system ("buildah login --username $username --password $password $container_registry") or die $!; -0 == system ("buildah bud -t $tag -f $containerfile .") or die $!; +0 == system ("buildah bud -t $tag -f $containerfile $args .") or die $!; 0 == system ("buildah push $tag") or die $!; # --------------------------------------------------------------------------- # -- Push the latest if the branch is main -- 2.49.0 From 152f5b777abda1b18e3b231c295e2574f0e1cbdb Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Mon, 1 Apr 2024 14:31:47 +0200 Subject: [PATCH 08/15] Update builder --- build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build b/build index 0396413..36ebfe8 100755 --- a/build +++ b/build @@ -21,7 +21,7 @@ # --------------------------------------------------------------------------- #! /bin/sh -echo "02.04.2024" +echo "01.04.2024" apk update apk add buildah cni-plugins iptables ip6tables fuse-overlayfs -- 2.49.0 From 9665015b44590b7ce2139f7acbad23af6628fff3 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Fri, 19 Apr 2024 17:01:24 +0200 Subject: [PATCH 09/15] Update builder --- build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build b/build index 36ebfe8..396683f 100755 --- a/build +++ b/build @@ -21,7 +21,7 @@ # --------------------------------------------------------------------------- #! /bin/sh -echo "01.04.2024" +echo "19.04.2024" apk update apk add buildah cni-plugins iptables ip6tables fuse-overlayfs -- 2.49.0 From 984f11e837561820c99673e226c873fb3512d450 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Sat, 25 May 2024 14:33:08 +0200 Subject: [PATCH 10/15] Try migrating to Woodpecker --- .drone.yml | 31 ------------------------------- .woodpecker.yaml | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 31 deletions(-) delete mode 100644 .drone.yml create mode 100644 .woodpecker.yaml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 9db2b5f..0000000 --- a/.drone.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -# ---------------------------------------------- -# -- Build an image and push it to the registry -# ---------------------------------------------- -kind: pipeline -type: docker -name: Build the builder - -trigger: - event: - - push - -steps: - - name: Prepare the builder image - image: alpine - privileged: true - environment: - GITEA_TOKEN: - from_secret: GITEA_TOKEN - BUILDAH_REG: git.badhouseplants.net/badhouseplants/badhouseplants-builder - commands: - - ./build - - - name: Cleanup - image: git.badhouseplants.net/badhouseplants/badhouseplants-builder:latest - environment: - GITEA_TOKEN: - from_secret: GITEA_TOKEN - BUILDAH_REG: git.badhouseplants.net/badhouseplants/badhouseplants-builder - commands: - - cleanup diff --git a/.woodpecker.yaml b/.woodpecker.yaml new file mode 100644 index 0000000..991f084 --- /dev/null +++ b/.woodpecker.yaml @@ -0,0 +1,33 @@ +--- +when: + event: + - push + +steps: + build: + image: alpine + name: Build shoebill operator image + privileged: true + commands: + - ./build + secrets: + - gitea_token + backend_options: + kubernetes: + resources: + requests: + memory: 500Mi + cpu: 200m + limits: + memory: 1000Mi + cpu: 1000m + securityContext: + privileged: true + cleanup: + image: git.badhouseplants.net/badhouseplants/badhouseplants-builder:latest + secrets: + - gitea_token + environment: + BUILDAH_REG: git.badhouseplants.net/badhouseplants/badhouseplants-builder + commands: + - cleanup -- 2.49.0 From 40ad595694f937a25208046c94304d54e135dd07 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Sat, 25 May 2024 14:38:07 +0200 Subject: [PATCH 11/15] Try migrating to Woodpecker --- .woodpecker.yaml | 3 ++- build | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.woodpecker.yaml b/.woodpecker.yaml index 991f084..815d145 100644 --- a/.woodpecker.yaml +++ b/.woodpecker.yaml @@ -6,8 +6,9 @@ when: steps: build: image: alpine - name: Build shoebill operator image privileged: true + environment: + BUILDAH_REG: git.badhouseplants.net/badhouseplants/badhouseplants-builder commands: - ./build secrets: diff --git a/build b/build index 396683f..110abe3 100755 --- a/build +++ b/build @@ -26,9 +26,9 @@ apk update apk add buildah cni-plugins iptables ip6tables fuse-overlayfs buildah login -u allanger -p $GITEA_TOKEN git.badhouseplants.net -buildah build -t $BUILDAH_REG:$DRONE_COMMIT_SHA . -buildah tag $BUILDAH_REG:$DRONE_COMMIT_SHA $BUILDAH_REG:latest +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:$DRONE_COMMIT_SHA; + buildah push $BUILDAH_REG:$CI_COMMIT_SHA; buildah push $BUILDAH_REG:latest; fi -- 2.49.0 From f36cd03d00ce6624d86af735a5a293b3d694e1e7 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Sat, 25 May 2024 14:48:11 +0200 Subject: [PATCH 12/15] Try installing netavark --- build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build b/build index 110abe3..46bed99 100755 --- a/build +++ b/build @@ -23,7 +23,7 @@ echo "19.04.2024" apk update -apk add buildah cni-plugins iptables ip6tables fuse-overlayfs +apk add buildah cni-plugins iptables ip6tables fuse-overlayfs netavark buildah login -u allanger -p $GITEA_TOKEN git.badhouseplants.net buildah build -t $BUILDAH_REG:$CI_COMMIT_SHA . -- 2.49.0 From 758f12faca4976ecb6b57c4e77abc23e811cc69c Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Sun, 14 Jul 2024 11:08:24 +0200 Subject: [PATCH 13/15] Add netavark to the container --- Containerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Containerfile b/Containerfile index f6d9bb4..1b723b6 100644 --- a/Containerfile +++ b/Containerfile @@ -9,7 +9,7 @@ RUN cp $(which argocd) /out/argocd FROM registry.hub.docker.com/library/alpine RUN apk update --no-cache&&\ - apk add yq gettext openssl curl jq perl git git-lfs\ + 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 -- 2.49.0 From f60ed8ed788a558d539e71b90bb5c7387757b309 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Wed, 24 Jul 2024 18:08:22 +0200 Subject: [PATCH 14/15] Update builder --- build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build b/build index 46bed99..fc579db 100755 --- a/build +++ b/build @@ -21,7 +21,7 @@ # --------------------------------------------------------------------------- #! /bin/sh -echo "19.04.2024" +echo "24.07.2024" apk update apk add buildah cni-plugins iptables ip6tables fuse-overlayfs netavark -- 2.49.0 From 38d9467a9f3d68060893fc1f995a37f8b93f3acc Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Wed, 24 Jul 2024 18:10:51 +0200 Subject: [PATCH 15/15] Trigger build -- 2.49.0