This repository was archived by the owner on Feb 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +127
-8
lines changed Expand file tree Collapse file tree 6 files changed +127
-8
lines changed Original file line number Diff line number Diff line change 46
46
push : true
47
47
tags : |
48
48
${{ env.IMAGE_BASE }}:kaniko-sidecar-pr-${{ github.event.pull_request.number }}
49
+
50
+ - name : link child image to current pr
51
+ run : |
52
+ sed -i --expression "s@FROM.*@FROM ${{ env.IMAGE_BASE }}:base-pr-${{ github.event.pull_request.number }}@g" images/ansible-k8s/Dockerfile
53
+
54
+ - name : Build github-actions-runner:ansible-k8s
55
+ uses : docker/build-push-action@v2
56
+ with :
57
+ context : ./images/ansible-k8s
58
+ push : true
59
+ tags : |
60
+ ${{ env.IMAGE_BASE }}:ansible-k8s-pr-${{ github.event.pull_request.number }}
Original file line number Diff line number Diff line change @@ -10,16 +10,23 @@ jobs:
10
10
runs-on : ubuntu-latest
11
11
steps :
12
12
- name : Delete base image
13
- uses : bots-house/ghcr-delete-image-action@v1
13
+ uses : bots-house/ghcr-delete-image-action@v1.0.0
14
14
with :
15
15
owner : ${{ github.repository_owner }}
16
16
name : github-actions-runner
17
17
token : ${{ secrets.GITHUB_TOKEN }}
18
18
tag : base-pr-${{ github.event.pull_request.number }}
19
19
- name : Delete kaniko-sidecar image
20
- uses : bots-house/ghcr-delete-image-action@v1
20
+ uses : bots-house/ghcr-delete-image-action@v1.0.0
21
21
with :
22
22
owner : ${{ github.repository_owner }}
23
23
name : github-actions-runner
24
24
token : ${{ secrets.GITHUB_TOKEN }}
25
- tag : kaniko-sidecar-pr-${{ github.event.pull_request.number }}
25
+ tag : kaniko-sidecar-pr-${{ github.event.pull_request.number }}
26
+ - name : Delete kaniko-sidecar image
27
+ uses :
bots-house/[email protected]
28
+ with :
29
+ owner : ${{ github.repository_owner }}
30
+ name : github-actions-runner
31
+ token : ${{ secrets.GITHUB_TOKEN }}
32
+ tag : ansible-k8s-pr-${{ github.event.pull_request.number }}
Original file line number Diff line number Diff line change @@ -43,17 +43,31 @@ jobs:
43
43
context : ./images/base
44
44
push : true
45
45
tags : |
46
- ${IMAGE_BASE}:latest
47
- ${IMAGE_BASE}:base-latest
48
- ${IMAGE_BASE}:base-${{needs.create_release.outputs.version}}
46
+ ${{ env. IMAGE_BASE } }:latest
47
+ ${{ env. IMAGE_BASE } }:base-latest
48
+ ${{ env. IMAGE_BASE } }:base-${{needs.create_release.outputs.version}}
49
49
50
50
- name : Build github-actions-runner:kaniko-sidecar
51
51
uses : docker/build-push-action@v2
52
52
with :
53
53
context : ./images/kaniko-sidecar
54
54
push : true
55
55
tags : |
56
- ${IMAGE_BASE}:kaniko-sidecar-${{needs.create_release.outputs.version}}
56
+ ${{ env.IMAGE_BASE }}:kaniko-sidecar-latest
57
+ ${{ env.IMAGE_BASE }}:kaniko-sidecar-${{needs.create_release.outputs.version}}
58
+
59
+ - name : link child image to current version
60
+ run : |
61
+ sed -i --expression "s@FROM.*@FROM ${{ env.IMAGE_BASE }}:base-${{ needs.create_release.outputs.version }}@g" images/ansible-k8s/Dockerfile
62
+
63
+ - name : Build github-actions-runner:ansible-k8s
64
+ uses : docker/build-push-action@v2
65
+ with :
66
+ context : ./images/ansible-k8s
67
+ push : true
68
+ tags : |
69
+ ${{ env.IMAGE_BASE }}:ansible-k8s-latest
70
+ ${{ env.IMAGE_BASE }}:ansible-k8s-${{needs.create_release.outputs.version}}
57
71
58
72
publish_release :
59
73
runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 1
1
# github-runner-base
2
2
Base Image for github runner images in repo @fullstack-devops/github-runner . Can also be used as standalone image.
3
3
4
+ Available Containers:
5
+ | Name | Description |
6
+ | ------------------------------------------------------------------------| ------------------------------------------------------------------------------------------------------------------------|
7
+ | ` ghcr.io/fullstack-devops/github-actions-runner:base-latest ` | Base runner with nothing fancy installed |
8
+ | ` ghcr.io/fullstack-devops/github-actions-runner:kaniko-sidecar-latest ` | Sidecar used by Runner to build containers without root privileges |
9
+ | ` ghcr.io/fullstack-devops/github-actions-runner:ansible-k8s-latest ` | Rrunner with ansible, kubectl and helm installed <br > For more Details see [ Dockerfile] ( images/ansible-k8s/Dockerfile ) |
10
+
4
11
---
5
12
6
13
## Environmental variables
@@ -82,7 +89,33 @@ services:
82
89
83
90
### kubernetes pod
84
91
85
- tbd
92
+ ` ` ` yaml
93
+ apiVersion : v1
94
+ kind : Pod
95
+ metadata :
96
+ name : gha-runner-kaniko
97
+ spec :
98
+ volumes :
99
+ - name : workspace-volume
100
+ emptyDir : {}
101
+ containers :
102
+ - name : github-actions-runner
103
+ image : ghcr.io/fullstack-devops/github-actions-runner:base-latest
104
+ resources : {}
105
+ volumeMounts :
106
+ - name : workspace-volume
107
+ mountPath : /kaniko/workspace/
108
+ imagePullPolicy : Never
109
+ tty : true
110
+ - name : kaniko-sidecar
111
+ image : ghcr.io/fullstack-devops/github-actions-runner:kaniko-sidecar-latest
112
+ resources : {}
113
+ volumeMounts :
114
+ - name : workspace-volume
115
+ mountPath : /kaniko/workspace/
116
+ imagePullPolicy : Never
117
+ restartPolicy : Never
118
+ ` ` `
86
119
87
120
### helm
88
121
Original file line number Diff line number Diff line change
1
+ FROM ghcr.io/fullstack-devops/github-actions-runner:base-latest
2
+
3
+ USER root
4
+ # install packages along with jq so we can parse JSON
5
+ # add additional packages as necessary
6
+ ARG PACKAGES="ansible"
7
+
8
+ RUN apt-get update \
9
+ && apt-get install -y --no-install-recommends ${PACKAGES} \
10
+ && rm -rf /var/lib/apt/lists/* \
11
+ && apt-get clean
12
+
13
+ ENV GH_RUNNER_LABELS="ubuntu-20.04,ansible-k8s"
14
+ ARG KUBECTL_VERSION=1.21.0
15
+ ARG HELM_VERSION=3.6.3
16
+
17
+ # Install kubectl
18
+ RUN wget -q https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl -O /usr/local/bin/kubectl \
19
+ && chmod +x /usr/local/bin/kubectl
20
+
21
+ # Install helm
22
+ RUN wget -q https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz -O - | tar -xzO linux-amd64/helm > /usr/local/bin/helm \
23
+ && chmod +x /usr/local/bin/helm
24
+
25
+ ENV TMP_DIR=/home/${USERNAME}/tmp
26
+
27
+ RUN mkdir /home/${USERNAME}/.ansible
28
+ RUN mkdir ${TMP_DIR}
29
+
30
+ COPY requirements.yml ${TMP_DIR}/requirements.yml
31
+
32
+ RUN chown -R ${USERNAME} /home/${USERNAME}
33
+
34
+ USER ${USERNAME}
35
+
36
+ RUN ansible-galaxy install -c -r ${TMP_DIR}/requirements.yml
37
+ RUN ansible-galaxy collection install -c -r ${TMP_DIR}/requirements.yml
38
+
39
+ # install helm plugins helm push, appr && diff
40
+ RUN helm plugin install --version 0.10.2 https://github.com/chartmuseum/helm-push.git \
41
+ && helm plugin install --version 0.7.0 https://github.com/app-registry/appr-helm-plugin.git \
42
+ && helm plugin install --version 3.4.2 https://github.com/databus23/helm-diff
Original file line number Diff line number Diff line change
1
+ ---
2
+ roles :
3
+ - name : geerlingguy.helm
4
+ version : 1.0.0
5
+
6
+ collections :
7
+ - name : kubernetes.core
8
+ version : 1.2.0
9
+
10
+ - name : community.kubernetes
11
+ version : 1.0.0
You can’t perform that action at this time.
0 commit comments