Compare commits
14 Commits
7e4de22873
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| ad79c5e0eb | |||
| b33491571b | |||
| 5f4a01a781 | |||
| 3bfd67987c | |||
| d92a0ccceb | |||
| 0303429dbf | |||
| 146b4d2808 | |||
| 3a0e93e18f | |||
| 839b39f78e | |||
| 7917c198a7 | |||
| 2d883f6c31 | |||
| 760b67b9e8 | |||
| e0fee84e65 | |||
| b744adde0c |
@@ -7,17 +7,10 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: almalinux-8
|
runs-on: almalinux-8
|
||||||
container:
|
container:
|
||||||
image: git.query.consul/unkin/almalinux8:latest
|
image: git.query.consul/unkin/almalinux8-runnerdnd:latest
|
||||||
options: --privileged
|
options: --privileged
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Set up environment
|
|
||||||
run: |
|
|
||||||
dnf install -y yum-utils
|
|
||||||
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
|
|
||||||
dnf module enable -y nodejs:20
|
|
||||||
dnf install -y docker-ce-cli make bash git nodejs
|
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
|||||||
@@ -9,17 +9,10 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: almalinux-8
|
runs-on: almalinux-8
|
||||||
container:
|
container:
|
||||||
image: git.query.consul/unkin/almalinux8:latest
|
image: git.query.consul/unkin/almalinux8-runnerdnd:latest
|
||||||
options: --privileged
|
options: --privileged
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Set up environment
|
|
||||||
run: |
|
|
||||||
dnf install -y yum-utils
|
|
||||||
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
|
|
||||||
dnf module enable -y nodejs:20
|
|
||||||
dnf install -y docker-ce-cli make bash git nodejs
|
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
|||||||
@@ -1,33 +1,48 @@
|
|||||||
# Get the current Git commit hash
|
# Variables
|
||||||
GIT_COMMIT := $(shell git rev-parse --short HEAD)
|
GIT_COMMIT := $(shell git rev-parse --short HEAD)
|
||||||
|
|
||||||
# Get the current date in YYYYMMDD format
|
|
||||||
DATE_TAG := $(shell date +%Y%m%d)
|
DATE_TAG := $(shell date +%Y%m%d)
|
||||||
|
|
||||||
# Set the Docker image name and repository information
|
|
||||||
IMAGE_NAME := alma8-buildagent
|
|
||||||
REGISTRY := git.query.consul
|
REGISTRY := git.query.consul
|
||||||
OWNER := unkin
|
OWNER := unkin
|
||||||
|
|
||||||
# Build the Docker image (without tags)
|
# List of releases (directories under ./release)
|
||||||
build:
|
RELEASES := $(shell find release -mindepth 1 -maxdepth 1 -type d -exec basename {} \;)
|
||||||
docker build --network=host -t $(REGISTRY)/$(OWNER)/$(IMAGE_NAME) .
|
|
||||||
|
|
||||||
# Tag the Docker image with the Git commit hash, the date, and 'latest'
|
# Build all releases
|
||||||
tag:
|
build: $(addprefix build-,$(RELEASES))
|
||||||
docker tag $(REGISTRY)/$(OWNER)/$(IMAGE_NAME) $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):$(GIT_COMMIT)
|
|
||||||
docker tag $(REGISTRY)/$(OWNER)/$(IMAGE_NAME) $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):$(DATE_TAG)
|
|
||||||
docker tag $(REGISTRY)/$(OWNER)/$(IMAGE_NAME) $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):latest
|
|
||||||
|
|
||||||
# Push the Docker image to a repository with all tags
|
# Tag all releases
|
||||||
push: tag
|
tag: $(addprefix tag-,$(RELEASES))
|
||||||
docker push $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):$(GIT_COMMIT)
|
|
||||||
docker push $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):$(DATE_TAG)
|
|
||||||
docker push $(REGISTRY)/$(OWNER)/$(IMAGE_NAME):latest
|
|
||||||
|
|
||||||
# Clean up dangling Docker images
|
# Push all releases
|
||||||
|
push: $(addprefix push-,$(RELEASES))
|
||||||
|
|
||||||
|
# Clean dangling images
|
||||||
clean:
|
clean:
|
||||||
docker image prune -f
|
docker image prune -f
|
||||||
|
|
||||||
|
# List all available releases
|
||||||
|
list:
|
||||||
|
@echo "Available releases:"
|
||||||
|
@echo $(RELEASES) | tr ' ' '\n'
|
||||||
|
|
||||||
|
# Build a specific release
|
||||||
|
build-%:
|
||||||
|
$(info Building almalinux$*-buildagent Docker image)
|
||||||
|
docker build --network=host -t $(REGISTRY)/$(OWNER)/almalinux$*-buildagent -f release/$*/Dockerfile release/$*
|
||||||
|
|
||||||
|
# Tag a specific release
|
||||||
|
tag-%:
|
||||||
|
$(info Tagging almalinux$*-buildagent Docker image)
|
||||||
|
docker tag $(REGISTRY)/$(OWNER)/almalinux$*-buildagent $(REGISTRY)/$(OWNER)/almalinux$*-buildagent:$(GIT_COMMIT)
|
||||||
|
docker tag $(REGISTRY)/$(OWNER)/almalinux$*-buildagent $(REGISTRY)/$(OWNER)/almalinux$*-buildagent:$(DATE_TAG)
|
||||||
|
docker tag $(REGISTRY)/$(OWNER)/almalinux$*-buildagent $(REGISTRY)/$(OWNER)/almalinux$*-buildagent:latest
|
||||||
|
|
||||||
|
# Push a specific release
|
||||||
|
push-%: tag-%
|
||||||
|
$(info Pushing almalinux$*-buildagent Docker image)
|
||||||
|
docker push $(REGISTRY)/$(OWNER)/almalinux$*-buildagent:$(GIT_COMMIT)
|
||||||
|
docker push $(REGISTRY)/$(OWNER)/almalinux$*-buildagent:$(DATE_TAG)
|
||||||
|
docker push $(REGISTRY)/$(OWNER)/almalinux$*-buildagent:latest
|
||||||
|
|
||||||
# Default target
|
# Default target
|
||||||
default: build
|
default: build
|
||||||
|
|||||||
@@ -1,17 +1,15 @@
|
|||||||
# Start with the AlmaLinux 8.10 base image
|
# Start with the AlmaLinux 8.10 base image
|
||||||
FROM git.query.consul/unkin/almalinux8:latest
|
FROM git.query.consul/unkin/almalinux8:latest
|
||||||
|
|
||||||
# Clean and update the repository cache
|
|
||||||
RUN dnf clean all && \
|
|
||||||
dnf makecache
|
|
||||||
|
|
||||||
# Install nodejs:20 for actions
|
# Install nodejs:20 for actions
|
||||||
RUN dnf module enable -y nodejs:20 && \
|
RUN dnf module enable -y nodejs:20 && \
|
||||||
dnf install -y nodejs
|
dnf install -y nodejs
|
||||||
|
|
||||||
# Install build-essential
|
# Install build tools and dependencies for building RPMs
|
||||||
RUN dnf groupinstall -y 'Development Tools' && \
|
RUN dnf clean all && \
|
||||||
dnf install -y make cmake gcc gcc-c++ rpm rpmdevtools wget
|
dnf makecache && \
|
||||||
|
dnf groupinstall -y 'Development Tools' && \
|
||||||
|
dnf install -y make cmake gcc gcc-c++ rpm rpmdevtools wget tar gzip go nfpm terragrunt terraform
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
RUN dnf clean all && \
|
RUN dnf clean all && \
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
# Start with the AlmaLinux 9 base image
|
||||||
|
FROM git.query.consul/unkin/almalinux9:latest
|
||||||
|
|
||||||
|
# Install nodejs:20 for actions
|
||||||
|
RUN dnf module enable -y nodejs:20 && \
|
||||||
|
dnf install -y nodejs
|
||||||
|
|
||||||
|
# Install build tools and dependencies for building RPMs
|
||||||
|
RUN dnf clean all && \
|
||||||
|
dnf makecache && \
|
||||||
|
dnf groupinstall -y 'Development Tools' && \
|
||||||
|
dnf install -y make cmake gcc gcc-c++ rpm rpmdevtools wget tar gzip go nfpm terragrunt terraform
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
RUN dnf clean all && \
|
||||||
|
rm -rf /var/cache/dnf
|
||||||
Reference in New Issue
Block a user