From 04a4d6d795fec10d66220078e0c9415e5d53d63c Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sat, 23 Nov 2024 14:16:35 +1100 Subject: [PATCH 1/3] feat: update makefile --- .gitea/workflows/build.yaml | 4 ++-- Makefile | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 335e7b3..10aab35 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -21,9 +21,9 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - - name: Build Docker Image + - name: Build Packages run: | - make build + make all - name: Show tree run: | diff --git a/Makefile b/Makefile index 46e07cd..335c460 100644 --- a/Makefile +++ b/Makefile @@ -7,9 +7,12 @@ NFPM_VERSION := 2.41.1 PACKAGES := $(shell find $(RPMS_DIR) -mindepth 2 -maxdepth 2 -type d | sed "s|$(RPMS_DIR)/||") # Default target to build all packages and versions -.PHONY: all +.PHONY: all list build buildall clean all: $(PACKAGES) +list: + @echo "$(PACKAGES)" + # Build specific package/version .PHONY: $(PACKAGES) $(PACKAGES): @@ -19,7 +22,6 @@ $(PACKAGES): $(MAKE) build PACKAGE_NAME=$$PACKAGE_NAME PACKAGE_VERSION=$$PACKAGE_VERSION # Build target -.PHONY: build build: @mkdir -p $(ROOT_DIR)/dist/$(PACKAGE_NAME)/ @echo "Preparing to build $(PACKAGE_NAME) version $(PACKAGE_VERSION)" @@ -39,7 +41,6 @@ build: docker rm $(PACKAGE_NAME)-$(PACKAGE_VERSION)-builder # Clean target -.PHONY: clean clean: @echo "Cleaning build artifacts..." rm -rf $(ROOT_DIR)/dist -- 2.47.3 From 346861ff9a10f5764556cb730a29403305694500 Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sat, 23 Nov 2024 14:17:48 +1100 Subject: [PATCH 2/3] feat: update deploy workflow --- .gitea/workflows/deploy.yaml | 14 ++++++++++++-- rpms/terragrunt/0.69.0/deploy | 1 + rpms/terragrunt/0.69.0/release | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 rpms/terragrunt/0.69.0/deploy create mode 100644 rpms/terragrunt/0.69.0/release diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 1ceda77..d7b2647 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -1,7 +1,9 @@ -name: Build +name: Deploy on: - pull_request: + push: + branches: + - master jobs: build: @@ -24,3 +26,11 @@ jobs: - name: Build Docker Image run: | make build + + - name: Upload RPMs to Gitea + env: + DRONECI_PASSWORD: ${{ secrets.DRONECI_PASSWORD }} + run: | + for deploy in /workspace/src/rpmbuild/RPMS/*/*.rpm; do + curl --user droneci:${{ secrets.DRONECI_PASSWORD }} --upload-file $rpm https://git.query.consul/api/packages/unkin/rpm/almalinux/el8/upload + done diff --git a/rpms/terragrunt/0.69.0/deploy b/rpms/terragrunt/0.69.0/deploy new file mode 100644 index 0000000..1621a8b --- /dev/null +++ b/rpms/terragrunt/0.69.0/deploy @@ -0,0 +1 @@ +almalinux/el8 diff --git a/rpms/terragrunt/0.69.0/release b/rpms/terragrunt/0.69.0/release new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/rpms/terragrunt/0.69.0/release @@ -0,0 +1 @@ +1 -- 2.47.3 From 010d6a7b802454e790232abc63e818bc469d4ad8 Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sat, 30 Nov 2024 23:53:02 +1100 Subject: [PATCH 3/3] feat: change to buildrunner - cleaned up multiple layers - removed deploy file - updated deploy workflow --- .gitea/workflows/build.yaml | 4 ++-- .gitea/workflows/deploy.yaml | 2 +- Makefile | 2 -- rpms/terragrunt/0.68.14/deploy | 1 - rpms/terragrunt/0.69.0/deploy | 1 - rpms/terragrunt/Dockerfile | 15 +-------------- 6 files changed, 4 insertions(+), 21 deletions(-) delete mode 100644 rpms/terragrunt/0.68.14/deploy delete mode 100644 rpms/terragrunt/0.69.0/deploy diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 10aab35..dba7046 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -25,6 +25,6 @@ jobs: run: | make all - - name: Show tree + - name: Show RPMs run: | - tree /workspace + find /workspace -type f -name "*.rpm" diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index d7b2647..ffbd9c9 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -31,6 +31,6 @@ jobs: env: DRONECI_PASSWORD: ${{ secrets.DRONECI_PASSWORD }} run: | - for deploy in /workspace/src/rpmbuild/RPMS/*/*.rpm; do + for rpm in $(find /workspace -type f -name "*.rpm"); do curl --user droneci:${{ secrets.DRONECI_PASSWORD }} --upload-file $rpm https://git.query.consul/api/packages/unkin/rpm/almalinux/el8/upload done diff --git a/Makefile b/Makefile index 335c460..18fe99c 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,6 @@ # Variables ROOT_DIR := $(PWD) RPMS_DIR := $(ROOT_DIR)/rpms -NFPM_VERSION := 2.41.1 # Automatically find all package/version directories PACKAGES := $(shell find $(RPMS_DIR) -mindepth 2 -maxdepth 2 -type d | sed "s|$(RPMS_DIR)/||") @@ -29,7 +28,6 @@ build: export PACKAGE_RELEASE=$$(cat $(PACKAGE_VERSION)/release) && \ echo "Using PACKAGE_RELEASE=$${PACKAGE_RELEASE}" && \ docker build \ - --build-arg NFPM_VERSION=$(NFPM_VERSION) \ --build-arg PACKAGE_VERSION=$(PACKAGE_VERSION) \ --build-arg PACKAGE_RELEASE=$${PACKAGE_RELEASE} \ -t $$(echo $(PACKAGE_NAME)-builder \ diff --git a/rpms/terragrunt/0.68.14/deploy b/rpms/terragrunt/0.68.14/deploy deleted file mode 100644 index 1621a8b..0000000 --- a/rpms/terragrunt/0.68.14/deploy +++ /dev/null @@ -1 +0,0 @@ -almalinux/el8 diff --git a/rpms/terragrunt/0.69.0/deploy b/rpms/terragrunt/0.69.0/deploy deleted file mode 100644 index 1621a8b..0000000 --- a/rpms/terragrunt/0.69.0/deploy +++ /dev/null @@ -1 +0,0 @@ -almalinux/el8 diff --git a/rpms/terragrunt/Dockerfile b/rpms/terragrunt/Dockerfile index b7593af..df049c7 100644 --- a/rpms/terragrunt/Dockerfile +++ b/rpms/terragrunt/Dockerfile @@ -1,5 +1,5 @@ # Start with the AlmaLinux 8.10 base image -FROM git.query.consul/unkin/almalinux8:latest +FROM git.query.consul/unkin/almalinux8-buildagent:latest # Create output directory for RPMs RUN mkdir -p /app/dist @@ -11,19 +11,6 @@ ARG PACKAGE_RELEASE ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ARG PACKAGE_VERSION ENV PACKAGE_VERSION=${PACKAGE_VERSION} -ARG NFPM_VERSION -ENV NFPM_VERSION=${NFPM_VERSION} - -# Clean and update the repository cache -RUN dnf clean all && \ - dnf makecache - -# Install build tools and dependencies for building RPMs -RUN dnf groupinstall -y 'Development Tools' && \ - dnf install -y make cmake gcc gcc-c++ rpm rpmdevtools wget tar gzip - -# Install nfpm using the RPM package -RUN dnf install -y https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm-${NFPM_VERSION}-1.x86_64.rpm # Copy nfpm.yaml from the context into the container COPY nfpm.yaml /app/nfpm.yaml -- 2.47.3