Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build_container.yml and Dockerfile #25

Merged
merged 9 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
37 changes: 28 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ARG UBUNTU_CODENAME=jammy
rwaffen marked this conversation as resolved.
Show resolved Hide resolved

FROM ubuntu:22.04

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

ARG TARGETARCH
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 +56,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 +73,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",
"terraform_version": "1.6.2",
"pdk_version": "3.0.0.0",
"bolt_version": "3.27.4",
"puppetdb_termini_version": "7.15.0"
},
{
"puppet_release": 8,
"puppet_version": "8.3.1",
"terraform_version": "1.6.2",
"pdk_version": "3.0.0.0",
"bolt_version": "3.27.4",
"puppetdb_termini_version": "7.15.0"
}
]
}