Skip to content

Commit

Permalink
Merge pull request #25 from betadots/update_build
Browse files Browse the repository at this point in the history
Update build_container.yml and Dockerfile
  • Loading branch information
rwaffen committed Nov 28, 2023
2 parents e7f4c88 + f12965c commit bf1ff11
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 38 deletions.
44 changes: 26 additions & 18 deletions .github/workflows/build_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,45 @@ name: Build and publish a 🛢️ container

on:
push:
paths-ignore:
- '.github/**'
branches:
- 'main'
tags:
- '*'
workflow_dispatch:

jobs:
setup-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Source checkout
uses: actions/checkout@v4

- id: set-matrix
run: echo "matrix=$(jq -c . build_versions.json)" >> $GITHUB_OUTPUT

build-and-push-container:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs: setup-matrix
strategy:
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
steps:
- name: Build Puppet 7 container
uses: voxpupuli/gha-build-and-publish-a-container@v2
with:
registry_password: ${{ secrets.GITHUB_TOKEN }}
build_args: 'PUPPET_VERSION=7'
if: ${{ startsWith(github.ref_name, 'v7') }}

- name: Build Puppet 8 container
uses: voxpupuli/gha-build-and-publish-a-container@v2
with:
registry_password: ${{ secrets.GITHUB_TOKEN }}
build_args: 'PUPPET_VERSION=8'
if: ${{ startsWith(github.ref_name, 'v8') }}

- name: Build development tag
- name: Build Puppet Development Container ${{ matrix.puppet_release }}
uses: voxpupuli/gha-build-and-publish-a-container@v2
with:
registry_password: ${{ secrets.GITHUB_TOKEN }}
if: ${{ startsWith(github.ref_name, 'main') }}
build_args: |
PUPPET_RELEASE=${{ matrix.puppet_release }}
PUPPET_VERSION=${{ matrix.puppet_version }}
TERRAFORM_VERSION=${{ matrix.terraform_version }}
PDK_VERSION=${{ matrix.pdk_version }}
BOLT_VERSION=${{ matrix.bolt_version }}
PUPPETDB_TERMINI_VERSION=${{ matrix.puppetdb_termini_version }}
tags: |
ghcr.io/${{ github.repository }}:${{ github.ref_name }}-${{ matrix.puppet_release }}
ghcr.io/${{ github.repository }}:latest-${{ matrix.puppet_release }}
ghcr.io/${{ github.repository }}:latest
41 changes: 31 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM ubuntu:22.04
ARG UBUNTU_CODENAME=jammy

FROM ubuntu:${UBUNTU_CODENAME}

LABEL org.label-schema.maintainer="betadots GmbH <info@betadots.de>" \
org.label-schema.vendor="betadots" \
Expand All @@ -10,11 +12,30 @@ LABEL org.label-schema.maintainer="betadots GmbH <info@betadots.de>" \
org.label-schema.dockerfile="/Dockerfile"

ARG TARGETARCH

# needs to be set again, otherwise it is not available in the next stage
ARG UBUNTU_CODENAME

ARG PUPPET_RELEASE
ENV PUPPET_RELEASE=${PUPPET_RELEASE:-7}

ARG PUPPET_VERSION
ENV PUPPET_VERSION=${PUPPET_VERSION:-7}
ENV PUPPET_VERSION=${PUPPET_VERSION:-7.27.0}

ARG TERRAFORM_VERSION
ENV TERRAFORM_VERSION=${TERRAFORM_VERSION:-1.6.2}

ARG PDK_VERSION
ENV PDK_VERSION=${PDK_VERSION:-3.0.0.0}

ARG BOLT_VERSION
ENV BOLT_VERSION=${BOLT_VERSION:-3.27.4}

ARG PUPPETDB_TERMINI_VERSION
ENV PUPPETDB_TERMINI_VERSION=${PUPPETDB_TERMINI_VERSION:-7.15.0}

ENV DEBIAN_FRONTEND=noninteractive
ENV PUPPET_DEB=puppet${PUPPET_VERSION}-release-jammy.deb
ENV PUPPET_DEB=puppet${PUPPET_RELEASE}-release-${UBUNTU_CODENAME}.deb

ADD https://apt.puppet.com/${PUPPET_DEB} /${PUPPET_DEB}

Expand All @@ -37,11 +58,11 @@ RUN apt update && apt install -y --no-install-recommends \
make \
openssh-client \
openssl \
pdk \
pdk=${PDK_VERSION}-1${UBUNTU_CODENAME} \
pkg-config\
puppet-agent \
puppet-bolt \
puppetdb-termini \
puppet-agent=${PUPPET_VERSION}-1${UBUNTU_CODENAME} \
puppet-bolt=${BOLT_VERSION}-1${UBUNTU_CODENAME} \
puppetdb-termini=${PUPPETDB_TERMINI_VERSION}-1${UBUNTU_CODENAME} \
python3-yaml \
unzip \
wget \
Expand All @@ -54,12 +75,12 @@ RUN apt update && apt install -y --no-install-recommends \
&& locale-gen en_US.UTF-8
# && /opt/puppetlabs/puppet/bin/bundle install

ADD https://releases.hashicorp.com/terraform/1.6.2/terraform_1.6.2_linux_${TARGETARCH}.zip /terraform_1.6.2_linux_${TARGETARCH}.zip
ADD https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_${TARGETARCH}.zip /terraform_${TERRAFORM_VERSION}_linux_${TARGETARCH}.zip
RUN \
unzip terraform_1.6.2_linux_${TARGETARCH}.zip && \
unzip terraform_${TERRAFORM_VERSION}_linux_${TARGETARCH}.zip && \
mv terraform /usr/local/bin/terraform && \
chmod +x /usr/local/bin/terraform && \
rm terraform_1.6.2_linux_${TARGETARCH}.zip && \
rm terraform_${TERRAFORM_VERSION}_linux_${TARGETARCH}.zip && \
terraform --version

ENV BOLT_DISABLE_ANALYTICS=true
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
source 'https://rubygems.org'

gem 'hiera-eyaml', '~> 3.3'
gem 'onceover', '~> 3.20'
gem 'onceover-codequality', '~> 0.10'
gem 'onceover-lookup', '~> 0.1', '>= 0.1.1'
gem 'onceover-octocatalog-diff', '~> 0.1', '>= 0.1.8'
gem 'onceover', '~> 3.20'
gem 'r10k', '~> 4.0'
gem 'ra10ke', '~> 3.0'
gem 'voxpupuli-acceptance', '~> 3.0'
Expand Down
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
# Puppet Development Container

includes:

- bolt 3.27.2
- Puppet 7.26.0
- catalog_diff
- PDK 3.0.0
- Puppetdb-termini 7.14.0
- yamllint
- terraform 1.6.2
included fixed software see: [build_versions.json](build_versions.json)
20 changes: 20 additions & 0 deletions build_versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"include": [
{
"puppet_release": 7,
"puppet_version": "7.27.0",
"puppetdb_termini_version": "7.15.0",
"terraform_version": "1.6.2",
"pdk_version": "3.0.0.0",
"bolt_version": "3.27.4"
},
{
"puppet_release": 8,
"puppet_version": "8.3.1",
"puppetdb_termini_version": "8.2.0",
"terraform_version": "1.6.2",
"pdk_version": "3.0.0.0",
"bolt_version": "3.27.4"
}
]
}

0 comments on commit bf1ff11

Please sign in to comment.