diff --git a/rpms/cni-plugins/Dockerfile b/rpms/cni-plugins/Dockerfile index 149f08f..db37ece 100644 --- a/rpms/cni-plugins/Dockerfile +++ b/rpms/cni-plugins/Dockerfile @@ -17,8 +17,7 @@ COPY nfpm.yaml /app/nfpm.yaml COPY scripts /app/scripts # Download the required files -RUN dnf install -y unzip && \ - wget -O /app/cni-plugins-linux-amd64.tgz https://github.com/containernetworking/plugins/releases/download/v${PACKAGE_VERSION}/cni-plugins-linux-amd64-v${PACKAGE_VERSION}.tgz && \ +RUN wget -O /app/cni-plugins-linux-amd64.tgz https://github.com/containernetworking/plugins/releases/download/v${PACKAGE_VERSION}/cni-plugins-linux-amd64-v${PACKAGE_VERSION}.tgz && \ tar xf cni-plugins-linux-amd64.tgz # Default command to build RPMs diff --git a/rpms/consul-cni/1.7.1/release b/rpms/consul-cni/1.7.1/release new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/rpms/consul-cni/1.7.1/release @@ -0,0 +1 @@ +1 diff --git a/rpms/consul-cni/Dockerfile b/rpms/consul-cni/Dockerfile new file mode 100644 index 0000000..92da040 --- /dev/null +++ b/rpms/consul-cni/Dockerfile @@ -0,0 +1,25 @@ +# Start with the AlmaLinux 8.10 base image +FROM git.query.consul/unkin/almalinux8-rpmbuilder:latest + +# Create output directory for RPMs +RUN mkdir -p /app/dist + +# Set working directory +WORKDIR /app + +ARG PACKAGE_RELEASE +ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} +ARG PACKAGE_VERSION +ENV PACKAGE_VERSION=${PACKAGE_VERSION} + +# Copy nfpm.yaml from the context into the container +COPY nfpm.yaml /app/nfpm.yaml +COPY scripts /app/scripts + +# Download the required files +RUN dnf install -y unzip && \ + wget -O /app/consul-cni.zip https://releases.hashicorp.com/consul-cni/${PACKAGE_VERSION}/consul-cni_${PACKAGE_VERSION}_linux_amd64.zip && \ + unzip consul-cni.zip + +# Default command to build RPMs +CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm diff --git a/rpms/consul-cni/nfpm.yaml b/rpms/consul-cni/nfpm.yaml new file mode 100644 index 0000000..f07979b --- /dev/null +++ b/rpms/consul-cni/nfpm.yaml @@ -0,0 +1,34 @@ +# nfpm.yaml + +name: consul-cni +version: ${PACKAGE_VERSION} +release: ${PACKAGE_RELEASE} +arch: amd64 +platform: linux +section: default +priority: extra +description: "Plugin for Consul on Kubernetes to allow configuring traffic redirection rules without escalated container privileges." +maintainer: Hashicorp +homepage: https://hashicorp.com +license: Mozilla Public License, version 2.0 + +disable_globbing: false + +replaces: + - consul-cni + +# Files to include in the package +contents: + - src: /app/consul-cni + dst: /opt/cni/bin/consul-cni + file_info: + mode: 0755 + owner: root + group: root + +# Scripts to run during installation/removal (optional) +scripts: + preinstall: ./scripts/preinstall.sh +# postinstall: ./scripts/postinstall.sh +# preremove: ./scripts/preremove.sh +# postremove: ./scripts/postremove.sh diff --git a/rpms/consul-cni/scripts/preinstall.sh b/rpms/consul-cni/scripts/preinstall.sh new file mode 100755 index 0000000..945345a --- /dev/null +++ b/rpms/consul-cni/scripts/preinstall.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +mkdir -p /opt/cni/bin diff --git a/rpms/nomad-autoscaler/0.4.6/release b/rpms/nomad-autoscaler/0.4.6/release new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/rpms/nomad-autoscaler/0.4.6/release @@ -0,0 +1 @@ +1 diff --git a/rpms/nomad-autoscaler/Dockerfile b/rpms/nomad-autoscaler/Dockerfile new file mode 100644 index 0000000..791e488 --- /dev/null +++ b/rpms/nomad-autoscaler/Dockerfile @@ -0,0 +1,24 @@ +# Start with the AlmaLinux 8.10 base image +FROM git.query.consul/unkin/almalinux8-rpmbuilder:latest + +# Create output directory for RPMs +RUN mkdir -p /app/dist + +# Set working directory +WORKDIR /app + +ARG PACKAGE_RELEASE +ENV PACKAGE_RELEASE=${PACKAGE_RELEASE} +ARG PACKAGE_VERSION +ENV PACKAGE_VERSION=${PACKAGE_VERSION} + +# Copy nfpm.yaml from the context into the container +COPY nfpm.yaml /app/nfpm.yaml + +# Download the required files +RUN dnf install -y unzip && \ + wget -O /app/nomad-autoscaler.zip https://releases.hashicorp.com/nomad-autoscaler/${PACKAGE_VERSION}/nomad-autoscaler_${PACKAGE_VERSION}_linux_amd64.zip && \ + unzip nomad-autoscaler.zip + +# Default command to build RPMs +CMD nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm diff --git a/rpms/nomad-autoscaler/nfpm.yaml b/rpms/nomad-autoscaler/nfpm.yaml new file mode 100644 index 0000000..2d6b740 --- /dev/null +++ b/rpms/nomad-autoscaler/nfpm.yaml @@ -0,0 +1,35 @@ +# nfpm.yaml + +name: nomad-autoscaler +version: ${PACKAGE_VERSION} +release: ${PACKAGE_RELEASE} +arch: amd64 +platform: linux +section: default +priority: extra +description: "The Nomad Autoscaler is an autoscaling daemon for Nomad, architectured around plug-ins to allow for easy extensibility in terms of supported metrics sources, scaling targets and scaling algorithms." + +maintainer: Hashicorp +homepage: https://github.com/hashicorp/nomad-autoscaler +license: Mozilla Public License, version 2.0 + +disable_globbing: false + +replaces: + - nomad-autoscaler + +# Files to include in the package +contents: + - src: /app/nomad-autoscaler + dst: /usr/bin/nomad-autoscaler + file_info: + mode: 0755 + owner: root + group: root + +# Scripts to run during installation/removal (optional) +# scripts: +# preinstall: ./scripts/preinstall.sh +# postinstall: ./scripts/postinstall.sh +# preremove: ./scripts/preremove.sh +# postremove: ./scripts/postremove.sh