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

Commit 7addf1e

Browse files
authored
Merge pull request #37 from fullstack-devops/feature/enterprises-support
add enterprises support + update gh runner
2 parents d964c86 + 4528a35 commit 7addf1e

File tree

3 files changed

+22
-13
lines changed

3 files changed

+22
-13
lines changed

README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +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+
56
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).
67
With a focus on already installed software to avoid a subsequent installation by a `setup-action`.
78

@@ -13,8 +14,9 @@ Support: If you need help or a feature just open an issue!
1314
Package / Images: `ghcr.io/fullstack-devops/github-actions-runner`
1415

1516
Available Tags:
17+
1618
| Name (tag) | Installed Tools/ Software | Dockerfile | Description |
17-
|---------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|----------------------------------------------------------------------------------------------------|
19+
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------- |
1820
| `latest-base` | libffi-dev, libicu-dev, build-essential, libssl-dev, ca-certificates, jq, sed, grep, git, curl, wget, zip, [awesome-ci](https://github.com/fullstack-devops/awesome-ci), [alpaca](https://github.com/samuong/alpaca) | [Dockerfile](images/base/Dockerfile) | Base runner with nothing fancy installed, but with internet connection more tools can be installed |
1921
| `latest-kaniko-sidecar` | kaniko | [Dockerfile](images/kaniko-sidecar/Dockerfile) | Sidecar used by other runner images to build containers |
2022
| `latest-ansible-k8s` | base-image + ansible, helm, kubectl, skopeo | [Dockerfile](images/ansible-k8s/Dockerfile) | Runner specializing in automated k8s deployments via Ansible in your cluster |
@@ -32,20 +34,19 @@ Available Tags:
3234

3335
### Required environmental variables
3436

35-
| Variable | Type | Description |
36-
|-------------------|--------|-------------------------------------------------------------------------------------------------------------------|
37-
| `GH_ORG` | string | Points to the GitHub Organisation where the runner should be installed |
38-
| `GH_ACCESS_TOKEN` | string | Developer Token vor the GitHub Organisation<br> This Token can be personal and is onlv needed during installation |
37+
| Variable | Type | Description |
38+
| -------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------- |
39+
| `GH_ORG`, `GH_REPO` or `GH_ENTERPRISE` | string | Points to the GitHub enterprise, organisation or repo where the runner should be installed |
40+
| `GH_ACCESS_TOKEN` | string | Developer Token vor the GitHub Organisation<br> This Token can be personal and is onlv needed during installation |
3941

4042
### Optional environmental variables
4143

4244
For the helm values see the [values.yaml](https://github.com/fullstack-devops/helm-charts/blob/main/charts/github-actions-runner/values.yaml), section `envValues`
4345

4446
| Variable | Type | Default | Description |
45-
|-------------------|--------|--------------------------|----------------------------------------------------------------------|
47+
| ----------------- | ------ | ------------------------ | -------------------------------------------------------------------- |
4648
| `GH_URL` | string | `https://github.com` | For GitHub Enterprise support |
4749
| `GH_API_ENDPOINT` | string | `https://api.github.com` | For GitHub Enterprise support eg.: `https://git.example.com/api/v3/` |
48-
| `GH_REPO` | string | | installing a runner to a spezific repository |
4950
| `KANIKO_ENABLED` | bool | `false` | enable builds with kaniko (works only with kaniko-sidecar) |
5051

5152
---
@@ -57,11 +58,13 @@ For the helm values see the [values.yaml](https://github.com/fullstack-devops/he
5758
If you are using `docker` or `podman` the options and commands are basically the same.
5859

5960
Run registerd to an Organisation:
61+
6062
```bash
6163
docker run -e GH_ORG=fullstack-devops -e GH_ACCESS_TOKEN=ghp_**** ghcr.io/fullstack-devops/github-actions-runner:latest-base
6264
```
6365

6466
Run registerd to an Organisation and Repo:
67+
6568
```bash
6669
docker run -e GH_ORG=fullstack-devops -e GH_REPO=github-runner-testing -e GH_ACCESS_TOKEN=ghp_**** ghcr.io/fullstack-devops/github-actions-runner:latest-base
6770
```
@@ -78,18 +81,21 @@ docker-compose up -d
7881
### podman
7982

8083
Setup exchange directory (only nessesarry until podman supports emptyDir volumes)
84+
8185
```bash
8286
mkdir /tmp/delme
8387
```
8488

8589
Starting GitHub runner with podman
90+
8691
```bash
8792
cd examples/podman
8893

8994
podman play kube deployment.yml
9095
```
9196

9297
Removing GitHub runner an dumps
98+
9399
```bash
94100
podman pod rm gh-runner-kaniko -f
95101
rm -rf /tmp/delme
@@ -133,4 +139,5 @@ spec:
133139
```
134140
135141
### helm
142+
136143
https://github.com/fullstack-devops/helm-charts/tree/main/charts/github-actions-runner

images/base/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ENV GH_RUNNER_WORKDIR="/home/${USERNAME}"
1313
ENV GH_KANIKO_WORKDIR="/kaniko/workspace"
1414

1515
# https://github.com/actions/runner/releases
16-
ENV GH_RUNNER_VERSION=2.295.0
16+
ENV GH_RUNNER_VERSION=2.296.0
1717
ENV GH_RUNNER_LABELS=ubuntu-20.04
1818

1919
# https://github.com/fullstack-devops/awesome-ci/releases

images/base/helper-scripts/gh-entrypoint.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@ readonly _GH_API_ENDPOINT="${GH_API_ENDPOINT:-https://api.github.com}"
1111

1212
# Org/ Repo details
1313
if [ -z "$GH_ORG" ]; then
14-
echo "Please provide Organisation detail by setting GH_ORG"
15-
exit 255
16-
fi
17-
if [ -z "$GH_REPO" ]; then
1814
readonly RUNNER_URL="${_GH_URL}/${GH_ORG}"
1915
readonly RUNNER_REG_TOKEN_URL="${_GH_API_ENDPOINT}/orgs/${GH_ORG}/actions/runners/registration-token"
20-
else
16+
elif [ -z "$GH_REPO" ]; then
2117
readonly RUNNER_URL="${_GH_URL}/${GH_ORG}/${GH_REPO}"
2218
readonly RUNNER_REG_TOKEN_URL="${_GH_API_ENDPOINT}/repos/${GH_ORG}/${GH_REPO}/actions/runners/registration-token"
19+
elif [ -z "$GH_ENTERPRISE" ]; then
20+
readonly RUNNER_URL="${_GH_URL}/${GH_ENTERPRISE}"
21+
readonly RUNNER_REG_TOKEN_URL="${_GH_API_ENDPOINT}/enterprises/${GH_ENTERPRISEs}/actions/runners/registration-token"
22+
else
23+
echo "Please provide Organisation detail by setting GH_ORG"
24+
exit 255
2325
fi
2426

2527
# access details

0 commit comments

Comments
 (0)