Skip to content
This repository was archived by the owner on Feb 11, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
needs: [generate_infos, build_base]
strategy:
matrix:
flavor: [ansible-k8s, maven-adopt-8-ng, maven-temurin-11, fullstacked]
flavor: [ansible-k8s, maven-adopt-8-ng, maven-temurin-11, golang, ng-cli-karma, fullstacked]
steps:
- name: Check out the repo
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cleanup-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
flavor: [ansible-k8s, maven-adopt-8-ng, maven-temurin-11, fullstacked]
flavor: [ansible-k8s, maven-adopt-8-ng, maven-temurin-11, golang, ng-cli-karma, fullstacked]
steps:
- name: Delete github-actions-runner:${{ matrix.flavor }}
uses: bots-house/ghcr-delete-image-action@v1.0.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
needs: [create_release, build_base]
strategy:
matrix:
flavor: [ansible-k8s, maven-adopt-8-ng, maven-temurin-11, fullstacked]
flavor: [ansible-k8s, maven-adopt-8-ng, maven-temurin-11, golang, ng-cli-karma, fullstacked]
steps:
- name: Check out the repo
uses: actions/checkout@v2
Expand Down
59 changes: 59 additions & 0 deletions images/golang/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
FROM ghcr.io/fullstack-devops/github-actions-runner:latest-base

USER root
# install packages along with jq so we can parse JSON
# add additional packages as necessary
ARG PACKAGES="nodejs ansible"
ARG PACKAGES_PYTHON="kubernetes"

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

RUN apt-get update \
&& add-apt-repository -y --update ppa:ansible/ansible \
&& curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
&& apt-get install -y --no-install-recommends ${PACKAGES} \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

ENV GH_RUNNER_LABELS="ubuntu-20.04,nodejs,go,golang,helm,ansible"
# https://github.com/helm/helm/releases
ARG HELM_VERSION=3.8.1
# https://go.dev/dl/
ARG GO_VERSION=1.18

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

# install build tools for golang
RUN export ARCH=$(/helper-scripts/translate-aarch.sh a-short) \
&& wget https://golang.org/dl/go${GO_VERSION}.linux-${ARCH}.tar.gz -O /usr/local/src/go.linux.tar.gz \
&& tar -xf /usr/local/src/go.linux.tar.gz \
&& rm -rf /usr/local/src/go.linux.tar.gz \
&& ln -s /usr/local/src/go/bin/go /usr/local/bin/

ENV TMP_DIR=/home/${USERNAME}/tmp

RUN mkdir /run/user/$USERID \
&& mkdir /home/${USERNAME}/.ansible \
&& mkdir ${TMP_DIR}

COPY requirements.yml ${TMP_DIR}/requirements.yml

RUN chown -R $USERNAME /home/$USERNAME \
&& chown -R $USERNAME /run/user/$USERID

USER $USERNAME

RUN pip3 install $PACKAGES_PYTHON --user

# RUN ansible-galaxy install -c -r ${TMP_DIR}/requirements.yml
RUN ansible-galaxy collection install -c -r ${TMP_DIR}/requirements.yml

# install helm plugins helm push, appr && diff
RUN helm plugin install --version 0.10.2 https://github.com/chartmuseum/helm-push.git \
&& helm plugin install --version 0.7.0 https://github.com/app-registry/appr-helm-plugin.git \
&& helm plugin install --version 3.4.2 https://github.com/databus23/helm-diff
4 changes: 4 additions & 0 deletions images/golang/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
collections:
- name: kubernetes.core
version: 2.3.1
66 changes: 66 additions & 0 deletions images/ng-cli-karma/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
FROM ghcr.io/fullstack-devops/github-actions-runner:latest-base

USER root
# install packages along with jq so we can parse JSON
# add additional packages as necessary
ARG PACKAGES="nodejs ansible chromium python3-selenium xvfb"
ARG PACKAGES_PYTHON="kubernetes"

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

## helper for karma and chromium
ENV CHROME_BIN="/usr/bin/chromium"
ADD xvfb-chromium /usr/bin/xvfb-chromium
ADD xvfb-chromium-webgl /usr/bin/xvfb-chromium-webgl
ADD display-chromium /usr/bin/display-chromium

RUN chmod +x /usr/bin/display-chromium /usr/bin/xvfb-chromium-webgl /usr/bin/xvfb-chromium

RUN apt-get update \
&& add-apt-repository -y --update ppa:ansible/ansible \
&& add-apt-repository -y --update ppa:xtradeb/apps \
&& curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
&& apt-get install -y --no-install-recommends ${PACKAGES} \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

ENV GH_RUNNER_LABELS="ubuntu-20.04,nodejs,yarn,karma,chrome,helm,ansible"
# https://github.com/helm/helm/releases
ARG HELM_VERSION=3.8.1
# https://go.dev/dl/
ARG GO_VERSION=1.18

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

ENV TMP_DIR=/home/${USERNAME}/tmp

RUN mkdir /run/user/$USERID \
&& mkdir /home/${USERNAME}/.ansible \
&& mkdir ${TMP_DIR}

COPY requirements.yml ${TMP_DIR}/requirements.yml

RUN chown -R $USERNAME /home/$USERNAME \
&& chown -R $USERNAME /run/user/$USERID

# install npm tools: yarn
ENV NPM_CONFIG_LOGLEVEL=warn NG_CLI_ANALYTICS=false
RUN npm install --location=global yarn pnpm @angular/cli@14 \
&& npm cache clean --force

USER $USERNAME

RUN pip3 install $PACKAGES_PYTHON --user

# RUN ansible-galaxy install -c -r ${TMP_DIR}/requirements.yml
RUN ansible-galaxy collection install -c -r ${TMP_DIR}/requirements.yml

# install helm plugins helm push, appr && diff
RUN helm plugin install --version 0.10.2 https://github.com/chartmuseum/helm-push.git \
&& helm plugin install --version 0.7.0 https://github.com/app-registry/appr-helm-plugin.git \
&& helm plugin install --version 3.4.2 https://github.com/databus23/helm-diff
3 changes: 3 additions & 0 deletions images/ng-cli-karma/display-chromium
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

$CHROME_BIN --disable-dev-shm-usage --no-sandbox --no-first-run $@
4 changes: 4 additions & 0 deletions images/ng-cli-karma/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
collections:
- name: kubernetes.core
version: 2.3.1
23 changes: 23 additions & 0 deletions images/ng-cli-karma/xvfb-chromium
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

find_free_servernum() {
i=0
while [ -f /tmp/.X$i-lock ]; do
i=$(($i + 1))
done
echo $i
}

export DISPLAY=":$(find_free_servernum)"
Xvfb "$DISPLAY" -ac -screen 0 "${XVFB_WHD:-1280x720x16}" -nolisten tcp +render &
xvfb_pid=$!

echo "(wrapper:) launching with: $@"

function cleanup {
kill -TERM $xvfb_pid > /dev/null 2>&1
}

trap cleanup EXIT

$CHROME_BIN --disable-dev-shm-usage --no-sandbox --disable-gpu --no-first-run $@
21 changes: 21 additions & 0 deletions images/ng-cli-karma/xvfb-chromium-webgl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

find_free_servernum() {
i=0
while [ -f /tmp/.X$i-lock ]; do
i=$(($i + 1))
done
echo $i
}

export DISPLAY=":$(find_free_servernum)"
Xvfb "$DISPLAY" -ac -screen 0 "${XVFB_WHD:-1280x800x16}" -nolisten tcp +render &
xvfb_pid=$!

function cleanup {
kill -TERM $xvfb_pid > /dev/null 2>&1
}

trap cleanup EXIT

$CHROME_BIN --no-sandbox --no-first-run --use-gl=osmesa --enable-webgl --ignore-gpu-blacklist --window-size=1024,768 $@