Compare commits

..

No commits in common. "a1590b56ee609aceb753c004b3461b153c93493c" and "63c708183b7770eb64fb838392c08ec586acefcd" have entirely different histories.

6 changed files with 26 additions and 22 deletions

View File

@ -21,10 +21,10 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Build Packages - name: Build Docker Image
run: | run: |
make all make build
- name: Show RPMs - name: Show tree
run: | run: |
find /workspace -type f -name "*.rpm" tree /workspace

View File

@ -1,9 +1,7 @@
name: Deploy name: Build
on: on:
push: pull_request:
branches:
- master
jobs: jobs:
build: build:
@ -26,11 +24,3 @@ jobs:
- name: Build Docker Image - name: Build Docker Image
run: | run: |
make build make build
- name: Upload RPMs to Gitea
env:
DRONECI_PASSWORD: ${{ secrets.DRONECI_PASSWORD }}
run: |
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

View File

@ -1,17 +1,15 @@
# Variables # Variables
ROOT_DIR := $(PWD) ROOT_DIR := $(PWD)
RPMS_DIR := $(ROOT_DIR)/rpms RPMS_DIR := $(ROOT_DIR)/rpms
NFPM_VERSION := 2.41.1
# Automatically find all package/version directories # Automatically find all package/version directories
PACKAGES := $(shell find $(RPMS_DIR) -mindepth 2 -maxdepth 2 -type d | sed "s|$(RPMS_DIR)/||") PACKAGES := $(shell find $(RPMS_DIR) -mindepth 2 -maxdepth 2 -type d | sed "s|$(RPMS_DIR)/||")
# Default target to build all packages and versions # Default target to build all packages and versions
.PHONY: all list build buildall clean .PHONY: all
all: $(PACKAGES) all: $(PACKAGES)
list:
@echo "$(PACKAGES)"
# Build specific package/version # Build specific package/version
.PHONY: $(PACKAGES) .PHONY: $(PACKAGES)
$(PACKAGES): $(PACKAGES):
@ -21,6 +19,7 @@ $(PACKAGES):
$(MAKE) build PACKAGE_NAME=$$PACKAGE_NAME PACKAGE_VERSION=$$PACKAGE_VERSION $(MAKE) build PACKAGE_NAME=$$PACKAGE_NAME PACKAGE_VERSION=$$PACKAGE_VERSION
# Build target # Build target
.PHONY: build
build: build:
@mkdir -p $(ROOT_DIR)/dist/$(PACKAGE_NAME)/ @mkdir -p $(ROOT_DIR)/dist/$(PACKAGE_NAME)/
@echo "Preparing to build $(PACKAGE_NAME) version $(PACKAGE_VERSION)" @echo "Preparing to build $(PACKAGE_NAME) version $(PACKAGE_VERSION)"
@ -28,6 +27,7 @@ build:
export PACKAGE_RELEASE=$$(cat $(PACKAGE_VERSION)/release) && \ export PACKAGE_RELEASE=$$(cat $(PACKAGE_VERSION)/release) && \
echo "Using PACKAGE_RELEASE=$${PACKAGE_RELEASE}" && \ echo "Using PACKAGE_RELEASE=$${PACKAGE_RELEASE}" && \
docker build \ docker build \
--build-arg NFPM_VERSION=$(NFPM_VERSION) \
--build-arg PACKAGE_VERSION=$(PACKAGE_VERSION) \ --build-arg PACKAGE_VERSION=$(PACKAGE_VERSION) \
--build-arg PACKAGE_RELEASE=$${PACKAGE_RELEASE} \ --build-arg PACKAGE_RELEASE=$${PACKAGE_RELEASE} \
-t $$(echo $(PACKAGE_NAME)-builder \ -t $$(echo $(PACKAGE_NAME)-builder \
@ -39,6 +39,7 @@ build:
docker rm $(PACKAGE_NAME)-$(PACKAGE_VERSION)-builder docker rm $(PACKAGE_NAME)-$(PACKAGE_VERSION)-builder
# Clean target # Clean target
.PHONY: clean
clean: clean:
@echo "Cleaning build artifacts..." @echo "Cleaning build artifacts..."
rm -rf $(ROOT_DIR)/dist rm -rf $(ROOT_DIR)/dist

View File

@ -0,0 +1 @@
almalinux/el8

View File

@ -1 +0,0 @@
1

View File

@ -1,5 +1,5 @@
# Start with the AlmaLinux 8.10 base image # Start with the AlmaLinux 8.10 base image
FROM git.query.consul/unkin/almalinux8-buildagent:latest FROM git.query.consul/unkin/almalinux8:latest
# Create output directory for RPMs # Create output directory for RPMs
RUN mkdir -p /app/dist RUN mkdir -p /app/dist
@ -11,6 +11,19 @@ ARG PACKAGE_RELEASE
ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} ENV PACKAGE_RELEASE=${PACKAGE_RELEASE}
ARG PACKAGE_VERSION ARG PACKAGE_VERSION
ENV PACKAGE_VERSION=${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 from the context into the container
COPY nfpm.yaml /app/nfpm.yaml COPY nfpm.yaml /app/nfpm.yaml