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

Commit 51b4b7a

Browse files
authored
Merge pull request #30 from fullstack-devops/feature/flavour-diversity
add two new flavours + quay.io
2 parents 4f4dac3 + 117f995 commit 51b4b7a

File tree

8 files changed

+162
-49
lines changed

8 files changed

+162
-49
lines changed

.github/workflows/build-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
needs: [generate_infos, build_base]
7474
strategy:
7575
matrix:
76-
flavor: [ansible-k8s, fullstacked]
76+
flavor: [ansible-k8s, maven-adopt-8-ng, maven-temurin-11, fullstacked]
7777
steps:
7878
- name: Check out the repo
7979
uses: actions/checkout@v2

.github/workflows/cleanup-pr.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types: [closed]
66

77
jobs:
8-
purge-image:
8+
purge_base_images:
99
name: Delete image from ghcr.io
1010
runs-on: ubuntu-latest
1111
steps:
@@ -25,18 +25,17 @@ jobs:
2525
token: ${{ secrets.GH_DEL_IMAGE_PAT }}
2626
tag: kaniko-sidecar-pr-${{ github.event.pull_request.number }}
2727

28-
- name: Delete github-actions-runner:ansible-k8s
29-
uses: bots-house/[email protected]
30-
with:
31-
owner: ${{ github.repository_owner }}
32-
name: github-actions-runner
33-
token: ${{ secrets.GH_DEL_IMAGE_PAT }}
34-
tag: ansible-k8s-pr-${{ github.event.pull_request.number }}
35-
36-
- name: Delete github-actions-runner:fullstacked
28+
purge_flavor_images:
29+
name: Delete image from ghcr.io
30+
runs-on: ubuntu-latest
31+
strategy:
32+
matrix:
33+
flavor: [ansible-k8s, maven-adopt-8-ng, maven-temurin-11, fullstacked]
34+
steps:
35+
- name: Delete github-actions-runner:${{ matrix.flavor }}
3736
uses: bots-house/[email protected]
3837
with:
3938
owner: ${{ github.repository_owner }}
4039
name: github-actions-runner
4140
token: ${{ secrets.GH_DEL_IMAGE_PAT }}
42-
tag: fullstacked-pr-${{ github.event.pull_request.number }}
41+
tag: ${{ matrix.flavor }}-pr-${{ github.event.pull_request.number }}

.github/workflows/create-release.yml

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- "main"
1111

1212
env:
13-
IMAGE_BASE: "ghcr.io/${{ github.repository_owner }}/github-actions-runner"
13+
IMAGE_NAME: "${{ github.repository_owner }}/github-actions-runner"
1414

1515
jobs:
1616
create_release:
@@ -31,6 +31,12 @@ jobs:
3131
registry: ghcr.io
3232
username: ${{ github.repository_owner }}
3333
password: ${{ secrets.GITHUB_TOKEN }}
34+
- name: Login to Red Hat Quay
35+
uses: docker/login-action@v1
36+
with:
37+
registry: quay.io
38+
username: ${{ secrets.RH_QUAY_USERNAME }}
39+
password: ${{ secrets.RH_QUAY_PASSWORD }}
3440

3541
- name: Set up QEMU
3642
uses: docker/setup-qemu-action@v1
@@ -43,9 +49,12 @@ jobs:
4349
context: ./images/base
4450
push: true
4551
tags: |
46-
${{ env.IMAGE_BASE }}:latest
47-
${{ env.IMAGE_BASE }}:latest-base
48-
${{ env.IMAGE_BASE }}:${{needs.create_release.outputs.version}}-base
52+
ghcr.io/${{ env.IMAGE_NAME }}:latest
53+
ghcr.io/${{ env.IMAGE_NAME }}:latest-base
54+
ghcr.io/${{ env.IMAGE_NAME }}:${{needs.create_release.outputs.version}}-base
55+
quay.io/${{ env.IMAGE_NAME }}:latest
56+
quay.io/${{ env.IMAGE_NAME }}:latest-base
57+
quay.io/${{ env.IMAGE_NAME }}:${{needs.create_release.outputs.version}}-base
4958
5059
build_kaniko-sidecar:
5160
runs-on: ubuntu-latest
@@ -60,6 +69,12 @@ jobs:
6069
registry: ghcr.io
6170
username: ${{ github.repository_owner }}
6271
password: ${{ secrets.GITHUB_TOKEN }}
72+
- name: Login to Red Hat Quay
73+
uses: docker/login-action@v1
74+
with:
75+
registry: quay.io
76+
username: ${{ secrets.RH_QUAY_USERNAME }}
77+
password: ${{ secrets.RH_QUAY_PASSWORD }}
6378

6479
- name: Set up QEMU
6580
uses: docker/setup-qemu-action@v1
@@ -72,15 +87,17 @@ jobs:
7287
context: ./images/kaniko-sidecar
7388
push: true
7489
tags: |
75-
${{ env.IMAGE_BASE }}:latest-kaniko-sidecar
76-
${{ env.IMAGE_BASE }}:${{needs.create_release.outputs.version}}-kaniko-sidecar
90+
ghcr.io/${{ env.IMAGE_NAME }}:latest-kaniko-sidecar
91+
ghcr.io/${{ env.IMAGE_NAME }}:${{needs.create_release.outputs.version}}-kaniko-sidecar
92+
quay.io/${{ env.IMAGE_NAME }}:latest-kaniko-sidecar
93+
quay.io/${{ env.IMAGE_NAME }}:${{needs.create_release.outputs.version}}-kaniko-sidecar
7794
7895
build_flavors:
7996
runs-on: ubuntu-latest
8097
needs: [create_release, build_base]
8198
strategy:
8299
matrix:
83-
flavor: [ansible-k8s, fullstacked]
100+
flavor: [ansible-k8s, maven-adopt-8-ng, maven-temurin-11, fullstacked]
84101
steps:
85102
- name: Check out the repo
86103
uses: actions/checkout@v2
@@ -91,6 +108,12 @@ jobs:
91108
registry: ghcr.io
92109
username: ${{ github.repository_owner }}
93110
password: ${{ secrets.GITHUB_TOKEN }}
111+
- name: Login to Red Hat Quay
112+
uses: docker/login-action@v1
113+
with:
114+
registry: quay.io
115+
username: ${{ secrets.RH_QUAY_USERNAME }}
116+
password: ${{ secrets.RH_QUAY_PASSWORD }}
94117

95118
- name: Set up QEMU
96119
uses: docker/setup-qemu-action@v1
@@ -99,7 +122,7 @@ jobs:
99122

100123
- name: link child image to current version
101124
run: |
102-
sed -i --expression "s@FROM ${{ env.IMAGE_BASE }}.*@FROM ${{ env.IMAGE_BASE }}:${{needs.create_release.outputs.version}}-base@g" \
125+
sed -i --expression "s@FROM ghcr.io/${{ env.IMAGE_NAME }}.*@FROM ghcr.io/${{ env.IMAGE_NAME }}:${{needs.create_release.outputs.version}}-base@g" \
103126
images/${{ matrix.flavor }}/Dockerfile
104127
105128
- name: Build github-actions-runner:${{ matrix.flavor }}
@@ -108,8 +131,10 @@ jobs:
108131
context: ./images/${{ matrix.flavor }}
109132
push: true
110133
tags: |
111-
${{ env.IMAGE_BASE }}:latest-${{ matrix.flavor }}
112-
${{ env.IMAGE_BASE }}:${{needs.create_release.outputs.version}}-${{ matrix.flavor }}
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 }}
113138
114139
publish_release:
115140
runs-on: ubuntu-latest

images/fullstacked/Dockerfile

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,28 @@ FROM ghcr.io/fullstack-devops/github-actions-runner:latest-base
33
USER root
44
# install packages along with jq so we can parse JSON
55
# add additional packages as necessary
6-
ARG PACKAGES="temurin-11-jdk maven nodejs ansible chromium python3-selenium xvfb"
6+
ARG PACKAGES="temurin-11-jdk maven ansible"
77
ARG PACKAGES_PYTHON="kubernetes"
88

99
## ansible keys
1010
RUN wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | apt-key add -
1111
RUN 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
1212

13-
## helper for karma and chromium
14-
ENV CHROME_BIN="/usr/bin/chromium"
15-
ADD xvfb-chromium /usr/bin/xvfb-chromium
16-
ADD xvfb-chromium-webgl /usr/bin/xvfb-chromium-webgl
17-
ADD display-chromium /usr/bin/display-chromium
18-
19-
RUN chmod +x /usr/bin/display-chromium /usr/bin/xvfb-chromium-webgl /usr/bin/xvfb-chromium
20-
2113
RUN apt-get update \
2214
&& add-apt-repository -y --update ppa:ansible/ansible \
23-
&& add-apt-repository -y --update ppa:xtradeb/apps \
24-
&& curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
2515
&& apt-get install -y --no-install-recommends ${PACKAGES} \
2616
&& rm -rf /var/lib/apt/lists/* \
2717
&& apt-get clean
2818

29-
ENV GH_RUNNER_LABELS="ubuntu-20.04,maven,temurin-11,nodejs,go,yarn,helm,ansible"
19+
ENV GH_RUNNER_LABELS="ubuntu-20.04,maven,temurin-11,helm,ansible"
3020
# https://github.com/helm/helm/releases
3121
ARG HELM_VERSION=3.8.1
32-
# https://go.dev/dl/
33-
ARG GO_VERSION=1.18
3422

3523
# Install helm
3624
RUN export ARCH=$(/helper-scripts/translate-aarch.sh a-short) \
3725
&& wget -q https://get.helm.sh/helm-v${HELM_VERSION}-linux-${ARCH}.tar.gz -O - | tar -xzO linux-${ARCH}/helm > /usr/local/bin/helm \
3826
&& chmod +x /usr/local/bin/helm
3927

40-
# install build tools for golang
41-
RUN export ARCH=$(/helper-scripts/translate-aarch.sh a-short) \
42-
&& wget https://golang.org/dl/go${GO_VERSION}.linux-${ARCH}.tar.gz -O /usr/local/src/go.linux.tar.gz \
43-
&& tar -xf /usr/local/src/go.linux.tar.gz \
44-
&& rm -rf /usr/local/src/go.linux.tar.gz \
45-
&& ln -s /usr/local/src/go/bin/go /usr/local/bin/
46-
47-
4828
ENV TMP_DIR=/home/${USERNAME}/tmp
4929

5030
RUN mkdir /run/user/$USERID
@@ -57,11 +37,6 @@ RUN mkdir -p /home/${USERNAME}/.m2/ \
5737
&& chown -R $USERNAME /home/$USERNAME \
5838
&& chown -R $USERNAME /run/user/$USERID
5939

60-
# install npm tools: yarn
61-
ENV NPM_CONFIG_LOGLEVEL=warn NG_CLI_ANALYTICS=false
62-
RUN npm install --location=global yarn pnpm @angular/cli@14 \
63-
&& npm cache clean --force
64-
6540
USER $USERNAME
6641

6742
RUN pip3 install $PACKAGES_PYTHON --user

images/maven-adopt-8-ng/Dockerfile

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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="openjdk-11-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+
RUN 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+
&& curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
16+
&& apt-get install -y --no-install-recommends ${PACKAGES} \
17+
&& rm -rf /var/lib/apt/lists/* \
18+
&& apt-get clean
19+
20+
ENV GH_RUNNER_LABELS="ubuntu-20.04,maven,openjdk-11,nodejs,go,yarn,helm,ansible"
21+
# https://github.com/helm/helm/releases
22+
ARG HELM_VERSION=3.8.1
23+
24+
# Install helm
25+
RUN export ARCH=$(/helper-scripts/translate-aarch.sh a-short) \
26+
&& wget -q https://get.helm.sh/helm-v${HELM_VERSION}-linux-${ARCH}.tar.gz -O - | tar -xzO linux-${ARCH}/helm > /usr/local/bin/helm \
27+
&& chmod +x /usr/local/bin/helm
28+
29+
ENV TMP_DIR=/home/${USERNAME}/tmp
30+
31+
RUN mkdir /run/user/$USERID
32+
RUN mkdir /home/${USERNAME}/.ansible
33+
RUN mkdir ${TMP_DIR}
34+
35+
COPY requirements.yml ${TMP_DIR}/requirements.yml
36+
37+
RUN mkdir -p /home/${USERNAME}/.m2/ \
38+
&& chown -R $USERNAME /home/$USERNAME \
39+
&& chown -R $USERNAME /run/user/$USERID
40+
41+
# install npm tools: yarn
42+
ENV NPM_CONFIG_LOGLEVEL=warn NG_CLI_ANALYTICS=false
43+
RUN npm install --location=global yarn pnpm @angular/cli@14 \
44+
&& npm cache clean --force
45+
46+
USER $USERNAME
47+
48+
RUN pip3 install $PACKAGES_PYTHON --user
49+
50+
# RUN ansible-galaxy install -c -r ${TMP_DIR}/requirements.yml
51+
RUN ansible-galaxy collection install -c -r ${TMP_DIR}/requirements.yml
52+
53+
# install helm plugins helm push, appr && diff
54+
RUN helm plugin install --version 0.10.2 https://github.com/chartmuseum/helm-push.git \
55+
&& helm plugin install --version 0.7.0 https://github.com/app-registry/appr-helm-plugin.git \
56+
&& 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

images/maven-temurin-11/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-11-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+
RUN 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-11,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)