Skip to content
This repository was archived by the owner on Feb 11, 2025. It is now read-only.

Commit 2147005

Browse files
committed
add temurin 17
1 parent fd487c1 commit 2147005

File tree

7 files changed

+98
-53
lines changed

7 files changed

+98
-53
lines changed

.github/flavours.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"flavour": [
3+
"ansible-k8s",
4+
"fullstacked",
5+
"golang",
6+
"kaniko-sidecar",
7+
"maven-adopt-8-ng",
8+
"maven-temurin-11",
9+
"maven-temurin-17",
10+
"ng-cli-karma"
11+
]
12+
}

.github/workflows/build-pr.yml

Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ jobs:
1212
secrets:
1313
token: ${{ secrets.GITHUB_TOKEN }}
1414

15+
load_matrix:
16+
runs-on: ubuntu-latest
17+
outputs:
18+
matrix: ${{ steps.set-matrix.outputs.matrix }}
19+
steps:
20+
- id: set-matrix
21+
run: |
22+
JSON=$(cat .github/flavours.json)
23+
echo "::set-output name=matrix::${JSON//'%'/'%25'}"
24+
1525
build_base:
1626
runs-on: ubuntu-latest
1727
needs: generate_infos
@@ -40,40 +50,11 @@ jobs:
4050
tags: |
4151
${{ env.IMAGE_BASE }}:base-pr-${{ github.event.pull_request.number }}
4252
43-
build_kaniko-sidecar:
44-
runs-on: ubuntu-latest
45-
needs: generate_infos
46-
steps:
47-
- name: Check out the repo
48-
uses: actions/checkout@v2
49-
50-
- name: Login to GitHub Container Registry
51-
uses: docker/login-action@v1
52-
with:
53-
registry: ghcr.io
54-
username: ${{ github.repository_owner }}
55-
password: ${{ secrets.GITHUB_TOKEN }}
56-
57-
- name: Set up QEMU
58-
uses: docker/setup-qemu-action@v1
59-
- name: Set up Docker Buildx
60-
id: buildx
61-
uses: docker/setup-buildx-action@v1
62-
63-
- name: Build github-actions-runner:kaniko-sidecar
64-
uses: docker/build-push-action@v2
65-
with:
66-
context: ./images/kaniko-sidecar
67-
push: true
68-
tags: |
69-
${{ env.IMAGE_BASE }}:kaniko-sidecar-pr-${{ github.event.pull_request.number }}
70-
71-
build_flavors:
53+
build_flavours:
7254
runs-on: ubuntu-latest
73-
needs: [generate_infos, build_base]
55+
needs: [generate_infos, load_matrix, build_base]
7456
strategy:
75-
matrix:
76-
flavor: [ansible-k8s, maven-adopt-8-ng, maven-temurin-11, golang, ng-cli-karma, fullstacked]
57+
matrix: ${{ fromJson(needs.load_matrix.outputs.matrix) }}
7758
steps:
7859
- name: Check out the repo
7960
uses: actions/checkout@v2
@@ -94,12 +75,12 @@ jobs:
9475
- name: link child image to current pr
9576
run: |
9677
sed -i --expression "s@FROM ${{ env.IMAGE_BASE }}.*@FROM ${{ env.IMAGE_BASE }}:base-pr-${{ github.event.pull_request.number }}@g" \
97-
images/${{ matrix.flavor }}/Dockerfile
78+
images/${{ matrix.flavour }}/Dockerfile
9879
99-
- name: Build github-actions-runner:${{ matrix.flavor }}
80+
- name: Build github-actions-runner:${{ matrix.flavour }}
10081
uses: docker/build-push-action@v2
10182
with:
102-
context: ./images/${{ matrix.flavor }}
83+
context: ./images/${{ matrix.flavour }}
10384
push: true
10485
tags: |
105-
${{ env.IMAGE_BASE }}:${{ matrix.flavor }}-pr-${{ github.event.pull_request.number }}
86+
${{ env.IMAGE_BASE }}:${{ matrix.flavour }}-pr-${{ github.event.pull_request.number }}

.github/workflows/cleanup-pr.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,16 @@ jobs:
2525
token: ${{ secrets.GH_DEL_IMAGE_PAT }}
2626
tag: kaniko-sidecar-pr-${{ github.event.pull_request.number }}
2727

28-
purge_flavor_images:
28+
purge_flavour_images:
2929
name: Delete image from ghcr.io
3030
runs-on: ubuntu-latest
3131
strategy:
32-
matrix:
33-
flavor: [ansible-k8s, maven-adopt-8-ng, maven-temurin-11, golang, ng-cli-karma, fullstacked]
32+
matrix: ${{ fromJson(.github/flavours.json) }}
3433
steps:
35-
- name: Delete github-actions-runner:${{ matrix.flavor }}
34+
- name: Delete github-actions-runner:${{ matrix.flavour }}
3635
uses: bots-house/ghcr-delete-image-action@v1.0.0
3736
with:
3837
owner: ${{ github.repository_owner }}
3938
name: github-actions-runner
4039
token: ${{ secrets.GH_DEL_IMAGE_PAT }}
41-
tag: ${{ matrix.flavor }}-pr-${{ github.event.pull_request.number }}
40+
tag: ${{ matrix.flavour }}-pr-${{ github.event.pull_request.number }}

.github/workflows/create-release.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,11 @@ jobs:
9292
quay.io/${{ env.IMAGE_NAME }}:latest-kaniko-sidecar
9393
quay.io/${{ env.IMAGE_NAME }}:${{needs.create_release.outputs.version}}-kaniko-sidecar
9494
95-
build_flavors:
95+
build_flavours:
9696
runs-on: ubuntu-latest
9797
needs: [create_release, build_base]
9898
strategy:
99-
matrix:
100-
flavor: [ansible-k8s, maven-adopt-8-ng, maven-temurin-11, golang, ng-cli-karma, fullstacked]
99+
matrix: ${{ fromJson(.github/flavours.json) }}
101100
steps:
102101
- name: Check out the repo
103102
uses: actions/checkout@v2
@@ -123,22 +122,22 @@ jobs:
123122
- name: link child image to current version
124123
run: |
125124
sed -i --expression "s@FROM ghcr.io/${{ env.IMAGE_NAME }}.*@FROM ghcr.io/${{ env.IMAGE_NAME }}:${{needs.create_release.outputs.version}}-base@g" \
126-
images/${{ matrix.flavor }}/Dockerfile
125+
images/${{ matrix.flavour }}/Dockerfile
127126
128-
- name: Build github-actions-runner:${{ matrix.flavor }}
127+
- name: Build github-actions-runner:${{ matrix.flavour }}
129128
uses: docker/build-push-action@v2
130129
with:
131-
context: ./images/${{ matrix.flavor }}
130+
context: ./images/${{ matrix.flavour }}
132131
push: true
133132
tags: |
134-
ghcr.io/${{ env.IMAGE_NAME }}:latest-${{ matrix.flavor }}
135-
ghcr.io/${{ env.IMAGE_NAME }}:${{needs.create_release.outputs.version}}-${{ matrix.flavor }}
136-
quay.io/${{ env.IMAGE_NAME }}:latest-${{ matrix.flavor }}
137-
quay.io/${{ env.IMAGE_NAME }}:${{needs.create_release.outputs.version}}-${{ matrix.flavor }}
133+
ghcr.io/${{ env.IMAGE_NAME }}:latest-${{ matrix.flavour }}
134+
ghcr.io/${{ env.IMAGE_NAME }}:${{needs.create_release.outputs.version}}-${{ matrix.flavour }}
135+
quay.io/${{ env.IMAGE_NAME }}:latest-${{ matrix.flavour }}
136+
quay.io/${{ env.IMAGE_NAME }}:${{needs.create_release.outputs.version}}-${{ matrix.flavour }}
138137
139138
publish_release:
140139
runs-on: ubuntu-latest
141-
needs: [create_release, build_base, build_flavors]
140+
needs: [create_release, build_base, build_flavours]
142141
steps:
143142
- name: Checkout code
144143
uses: actions/checkout@v2

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[![Anchore Container Scan](https://github.com/fullstack-devops/github-actions-runner/actions/workflows/anchore.yml/badge.svg)](https://github.com/fullstack-devops/github-actions-runner/actions/workflows/anchore.yml)
33

44
# GitHub Actions Custom Runner
5-
Container images with Github Actions Runner. Different flavored images with preinstalled tools and software for builds with limited internet access and non root privileges (exception for kaniko).
5+
Container images with Github Actions Runner. Different flavoured images with preinstalled tools and software for builds with limited internet access and non root privileges (exception for kaniko).
66
With a focus on already installed software to avoid a subsequent installation by a `setup-action`.
77

88
Ideal for building software in corporate environments of large and small organizations that often restrict Internet access.

images/maven-temurin-17/Dockerfile

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
FROM ghcr.io/fullstack-devops/github-actions-runner:latest-base
2+
3+
USER root
4+
# install packages along with jq so we can parse JSON
5+
# add additional packages as necessary
6+
ARG PACKAGES="temurin-17-jdk maven nodejs ansible"
7+
ARG PACKAGES_PYTHON="kubernetes"
8+
9+
## ansible keys
10+
RUN wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | apt-key add - \
11+
&& echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list
12+
13+
RUN apt-get update \
14+
&& add-apt-repository -y --update ppa:ansible/ansible \
15+
&& apt-get install -y --no-install-recommends ${PACKAGES} \
16+
&& rm -rf /var/lib/apt/lists/* \
17+
&& apt-get clean
18+
19+
ENV GH_RUNNER_LABELS="ubuntu-20.04,maven,temurin-17,helm,ansible"
20+
# https://github.com/helm/helm/releases
21+
ARG HELM_VERSION=3.8.1
22+
23+
# Install helm
24+
RUN export ARCH=$(/helper-scripts/translate-aarch.sh a-short) \
25+
&& wget -q https://get.helm.sh/helm-v${HELM_VERSION}-linux-${ARCH}.tar.gz -O - | tar -xzO linux-${ARCH}/helm > /usr/local/bin/helm \
26+
&& chmod +x /usr/local/bin/helm
27+
28+
ENV TMP_DIR=/home/${USERNAME}/tmp
29+
30+
RUN mkdir /run/user/$USERID
31+
RUN mkdir /home/${USERNAME}/.ansible
32+
RUN mkdir ${TMP_DIR}
33+
34+
COPY requirements.yml ${TMP_DIR}/requirements.yml
35+
36+
RUN mkdir -p /home/${USERNAME}/.m2/ \
37+
&& chown -R $USERNAME /home/$USERNAME \
38+
&& chown -R $USERNAME /run/user/$USERID
39+
40+
USER $USERNAME
41+
42+
RUN pip3 install $PACKAGES_PYTHON --user
43+
44+
# RUN ansible-galaxy install -c -r ${TMP_DIR}/requirements.yml
45+
RUN ansible-galaxy collection install -c -r ${TMP_DIR}/requirements.yml
46+
47+
# install helm plugins helm push, appr && diff
48+
RUN helm plugin install --version 0.10.2 https://github.com/chartmuseum/helm-push.git \
49+
&& helm plugin install --version 0.7.0 https://github.com/app-registry/appr-helm-plugin.git \
50+
&& helm plugin install --version 3.4.2 https://github.com/databus23/helm-diff
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
collections:
3+
- name: kubernetes.core
4+
version: 2.3.1

0 commit comments

Comments
 (0)