Compare commits

...
453 Commits
Author SHA1 Message Date
Marcus Young c35d11b3e0 [Automated 🤖 ] Bump to version 2.310.0 2023-10-09 08:50:28 -05:00
myoung34andGitHub 6ceb1d22be Merge pull request #324 from myoung34/renovate/actions-checkout-digest
Update actions/checkout digest to 8ade135
2023-09-22 15:52:03 -05:00
renovate[bot]andGitHub 8434e76f7a Update actions/checkout digest to 8ade135 2023-09-22 18:14:28 +00:00
myoung34andGitHub 96599f2388 Merge pull request #319 from myoung34/renovate/docker-login-action-3.x
Update docker/login-action action to v3
2023-09-12 07:12:56 -05:00
myoung34andGitHub 18d9460fdb Merge pull request #320 from myoung34/renovate/docker-setup-buildx-action-3.x
Update docker/setup-buildx-action action to v3
2023-09-12 07:12:46 -05:00
myoung34andGitHub 5cf71789a5 Merge pull request #321 from myoung34/renovate/docker-setup-qemu-action-3.x
Update docker/setup-qemu-action action to v3
2023-09-12 07:12:33 -05:00
renovate[bot]andGitHub bcabaf3047 Update docker/setup-qemu-action action to v3 2023-09-12 12:06:40 +00:00
renovate[bot]andGitHub a822249136 Update docker/setup-buildx-action action to v3 2023-09-12 12:06:36 +00:00
myoung34andGitHub 16bf61e038 Merge pull request #318 from myoung34/renovate/docker-build-push-action-5.x
Update docker/build-push-action action to v5
2023-09-12 07:06:22 -05:00
renovate[bot]andGitHub 3d633a3532 Update docker/login-action action to v3 2023-09-12 11:00:33 +00:00
renovate[bot]andGitHub 53fcddcca7 Update docker/build-push-action action to v5 2023-09-12 11:00:28 +00:00
Marcus Young af64b04ec6 [Automated 🤖 ] Bump to version 2.309.0 2023-09-07 11:43:47 -05:00
myoung34andGitHub 0e877f4aef Merge pull request #316 from myoung34/renovate/actions-checkout-4.x
Update actions/checkout action to v4
2023-09-04 08:26:43 -05:00
renovate[bot]andGitHub 33822a9108 Update actions/checkout action to v4 2023-09-04 13:23:17 +00:00
myoung34andGitHub 7e82d769c6 Merge pull request #315 from kmkacpermajor/master
Docker service dying fix
2023-09-02 10:12:00 -05:00
myoung34andGitHub c3ed823392 Update entrypoint.sh 2023-09-02 10:11:54 -05:00
kmkacpermajor 359b93cb8b fix 2023-08-25 19:12:33 +02:00
Marcus Young fa3beacfc7 [Automated 🤖 ] Bump to version 2.308.0 2023-08-14 05:50:45 -05:00
Marcus Young b0620cddd3 [Automated 🤖 ] Bump to version 2.307.1 2023-07-25 07:46:20 -05:00
Marcus Young 69c6706a93 [Automated 🤖 ] Bump to version 2.307.0 2023-07-24 06:35:29 -05:00
myoung34andGitHub 19e72e593a Merge pull request #312 from myoung34/renovate/actions-setup-python-4.x
Update actions/setup-python action to v4
2023-07-21 09:48:31 -05:00
renovate[bot]andGitHub a32f033a3a Update actions/setup-python action to v4 2023-07-21 14:47:46 +00:00
myoung34andGitHub d8f341cb13 Merge pull request #309 from myoung34/renovate/shellcheck-0.x
Update dependency shellcheck to v0.9.0
2023-07-21 09:46:53 -05:00
renovate[bot]andGitHub 691f0a2d0a Update dependency shellcheck to v0.9.0 2023-07-21 14:46:37 +00:00
myoung34andGitHub 2f5a5357f2 Merge pull request #310 from myoung34/renovate/actions-checkout-3.x
Update actions/checkout action to v3
2023-07-21 09:46:24 -05:00
renovate[bot]andGitHub e4c1b47fb1 Update actions/checkout action to v3 2023-07-21 14:43:53 +00:00
Marcus Young 816ea853f8 Add renovate 2023-07-21 09:43:35 -05:00
Marcus Young f5245230fa Fix dockerfile base for sid -> trixie 2023-07-18 10:19:28 -05:00
Marcus Young 003622052f [Automated 🤖 ] Bump to version 2.306.0 2023-07-07 06:54:34 -05:00
myoung34andGitHub 28036a223a Merge pull request #305 from myoung34/usr_path_fix
Fix path to chown for debian and ubuntu delta
2023-06-16 07:56:53 -05:00
Marcus Young 3849a3bb3a Ignore "Dockerfile.base:14 SC2015 info: Note that A && B || C is not if-then-else. C may run when A is true." 2023-06-16 07:55:59 -05:00
Marcus Young 19fbe505ed Fix path to chown for debian and ubuntu delta 2023-06-16 07:51:55 -05:00
Marcus Young c31412d677 [Automated 🤖 ] Bump to version 2.305.0 2023-06-14 08:23:41 -05:00
Marcus Young ca0201ca61 Clean up third party repos in base image 2023-06-09 07:19:50 -05:00
myoung34andGitHub 8a60195729 Merge pull request #302 from cloudsbird/master
feat: add the libpq-dev into dockerfile base
2023-05-25 06:23:58 -05:00
Vederis LeunardusandGitHub ec6a3c2b02 feat: add the libpq-dev into dockerfile base 2023-05-25 15:49:04 +08:00
myoung34andGitHub 869eed00ad Merge pull request #298 from LordChunk/pr/start-docker-with-env
Start Docker service with env variable
2023-05-16 11:23:40 -05:00
JobandGitHub 02345f60eb Added START_DOCKER_SERVICE to explanation 2023-05-16 12:18:44 +02:00
Job ce3fa67d01 Revert "Added steps for converting org and repo name to lower case"
This reverts commit 25ced0a285.
2023-05-15 21:41:12 +00:00
Job 0defbf05c9 Moved Docker start command before runner start 2023-05-15 21:14:08 +00:00
Job 25ced0a285 Added steps for converting org and repo name to lower case 2023-05-15 20:44:12 +00:00
Job 6f041688da Added ability to start docker service on startup 2023-05-15 19:59:54 +00:00
Marcus Young 9cb13e5d9d Bump docker/login-action@v1 to docker/login-action@v2 2023-05-03 09:38:07 -05:00
Marcus Young bede34073e Bump setup-buildx-action to v2, build-push-action to v4 2023-05-03 09:26:01 -05:00
Marcus Young aff2a788bf bump qemu action to v2 2023-05-03 09:22:16 -05:00
myoung34andGitHub a911c0ae52 Merge pull request #293 from viseshrp/patch-1
remove warning about compose on ARM
2023-04-30 15:15:02 -05:00
Visesh RajendraprasadandGitHub 558d9c966b remove warning about compose on ARM 2023-04-30 16:07:00 -04:00
Marcus Young e929641491 [Automated 🤖 ] Bump to version 2.304.0 2023-04-26 15:10:05 -05:00
myoung34andGitHub 4d04be45b3 Merge pull request #292 from wico-silva/fix/docker-compose-shebang
Fix docker compose shebang
2023-04-26 05:39:53 -05:00
David Silva c6c8324c99 Fix docker compose shebang 2023-04-13 16:37:11 +02:00
myoung34andGitHub 9a1f879815 Merge pull request #289 from barnesew/update-docker-compose
Update Docker Compose to v2
2023-03-28 14:06:37 -05:00
Evan Barnes 182f60392a Changing docker-compose script directory to /usr/local/bin. 2023-03-28 11:18:49 -04:00
Evan Barnes bdeda7540b Installing docker compose via the docker plugin and creating compatibility command for "docker-compose". 2023-03-28 10:34:41 -04:00
Koen De VleeschauwerandMarcus Young 37c5c6cedf add whitespace around gh version number
Co-authored-by: myoung34 <myoung34@my.apsu.edu>
2023-03-17 13:14:52 -05:00
Marcus Young ca56e475d5 [Automated 🤖 ] Bump to version 2.303.0 2023-03-10 05:09:42 -06:00
myoung34andGitHub 123abdad71 Merge pull request #285 from ultrr/master
Add docker-buildx-plugin
2023-03-07 10:31:05 -06:00
ultrr bc28f6b970 add docker-buildx-plugin 2023-03-03 09:48:21 +01:00
Marcus Young d6f3aa6c8e [Automated 🤖 ] Bump to version 2.302.1 2023-02-15 10:34:50 -06:00
Marcus Young a4cb10ea80 [Automated 🤖 ] Bump to version 2.302.0 2023-02-14 11:17:26 -06:00
myoung34andGitHub 03a6e8470a Merge pull request #282 from fabfuel/fabfuel/nested-default-branch
Make default workdir a subfolder under /_work
2023-02-10 07:38:31 -06:00
Fabian Fuelling a125d7e21e Make default workdir a subfolder under /_work 2023-02-07 16:00:54 +01:00
myoung34andGitHub 3f79a3e7e5 Merge pull request #276 from myoung34/bugfix/etc_hostname
Bugfix: /etc/hostname is not guaranteed, sane default to random string
2023-01-31 19:22:44 -06:00
Marcus Young 855113b437 Add new boolean for randomized suffix 2023-01-31 08:36:49 -06:00
Marcus Young 90bea89598 Add empty check for /etc/hostname 2023-01-31 08:12:09 -06:00
Marcus Young fb6fdfa1c5 Bugfix: /etc/hostname is not guaranteed, sane default to random string 2023-01-30 11:11:21 -06:00
Marcus Young 8b5cafc897 [Automated 🤖 ] Bump to version 2.301.1 2023-01-18 19:13:36 -06:00
Marcus Young b0f0762e05 [Automated 🤖 ] Bump to version 2.301.0 2023-01-18 14:10:34 -06:00
myoung34andGitHub 1c136849c9 Merge pull request #271 from iamironz/master
Added using docker hostname instead manual generated random
2023-01-16 08:31:20 -06:00
Aleksandr Efremenkov 9175b93a7b added using docker hostname instead manual generated random, updated README 2023-01-16 16:10:48 +02:00
Marcus Young 45574ba8bb Hotfix: fix outdated key for focal on opensuse gpg 2022-12-31 18:59:13 -06:00
Marcus Young ac2e2b9a5d [Automated 🤖 ] Bump to version 2.300.2 2022-12-19 13:27:52 -06:00
Marcus Young 02418d25e4 [Automated 🤖 ] Bump to version 2.300.1 2022-12-19 10:37:02 -06:00
Marcus Young ca30659d4e [Automated 🤖 ] Bump to version 2.300.0 2022-12-14 02:52:06 -06:00
myoung34andGitHub 0bb0b6227b Merge pull request #264 from Abramo-Bagnara/master
Allow to put APP_PRIVATE_KEY in Docker env file. Introduced APP_LOGIN…
2022-12-12 14:56:59 -06:00
myoung34andGitHub b92d9416f7 Merge pull request #268 from lumagi/remove_recursive_chown
Change recursive chown to flat chown for tools directory
2022-12-12 14:50:23 -06:00
Lukas Magel cb7a831054 Change recursive chown to flat chown for tools directory
If the tools cache is already populated with tooling in a derived docker
image, performing a recursive chown significantly slows down ephemeral
runner startup.
2022-12-12 20:52:43 +01:00
Abramo Bagnara c4dad6b826 Added some info about APP_LOGIN in README.md. 2022-12-12 19:03:03 +01:00
Abramo Bagnara b431a190e0 Improved backward compatibility with sane defaults for APP_LOGIN. 2022-12-09 08:08:27 +01:00
myoung34andGitHub b89c3a1c85 Merge pull request #263 from ilyesAj/patch-1
add zip package to dockerfile
2022-12-06 13:39:43 -06:00
myoung34andGitHub 7827dd56fa Merge pull request #265 from nmalaguti/master
Fix expired GPG key for opensuse kubic repository
2022-12-06 12:34:50 -06:00
Nick Malaguti 47b2f1d300 Fix expired GPG key for opensuse kubic repository
https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/Release.key
expired on 2022-12-06. An updated key with an expiration of 2025-01-30
is available at
https://build.opensuse.org/project/keys_and_certificates/devel:kubic.
2022-12-06 11:39:40 -05:00
Abramo Bagnara c56bb17e42 Allow to put APP_PRIVATE_KEY in Docker env file. Introduced APP_LOGIN to fix access token retrieval in case of multiple GitHub's App subscriber. 2022-12-06 08:50:29 +01:00
ilyes AjroudandGitHub 28f9ffd8d0 add zip package 2022-12-05 15:24:07 +01:00
myoung34andGitHub a7dc4a3dcc Merge pull request #254 from chantra/github_app
Add support for GitHub app authentication
2022-11-11 09:17:41 -05:00
Manu Bretelle fe3e411b16 entrypoint: make APP_ID/APP_PRIVATE_KEY mutually exclusive with
{ACCESS,RUNNER}_TOKEN.

```
$ docker run --env RUNNER_TOKEN=foo --env APP_ID=1234 --env APP_PRIVATE_KEY="$(<~/Downloads/cert.pem)" runner_app
REPO_URL required for repo runners
Runner reusage is disabled
ERROR: ACCESS_TOKEN or RUNNER_TOKEN provided but are mutually exclusive with APP_ID and APP_PRIVATE_KEY.
$ docker run --env ACCESS_TOKEN=foo --env APP_ID=1234 --env APP_PRIVATE_KEY="$(<~/Downloads/cert.pem)" runner_app
REPO_URL required for repo runners
Runner reusage is disabled
ERROR: ACCESS_TOKEN or RUNNER_TOKEN provided but are mutually exclusive with APP_ID and APP_PRIVATE_KEY.
$ docker run --env ACCESS_TOKEN=foo --env APP_ID=1234 --env APP_PRIVATE_KEY="$(<~/Downloads/cert.pem)" runner_app
$ docker run --env APP_ID=250536  runner_app
REPO_URL required for repo runners
Runner reusage is disabled
ERROR: Both APP_ID and APP_PRIVATE_KEY must be specified.
$ docker run --env APP_ID=1234 --env APP_PRIVATE_KEY="$(<~/Downloads/cert.pem)" runner_app

REPO_URL required for repo runners
Runner reusage is disabled
Obtaining access token for app_id 1234
Obtaining the token of the runner
curl: (22) The requested URL returned error: 404
Configuring

--------------------------------------------------------------------------------
|        ____ _ _   _   _       _          _        _   _                      |
|       / ___(_) |_| | | |_   _| |__      / \   ___| |_(_) ___  _ __  ___      |
|      | |  _| | __| |_| | | | | '_ \    / _ \ / __| __| |/ _ \| '_ \/ __|     |
|      | |_| | | |_|  _  | |_| | |_) |  / ___ \ (__| |_| | (_) | | | \__ \     |
|       \____|_|\__|_| |_|\__,_|_.__/  /_/   \_\___|\__|_|\___/|_| |_|___/     |
|                                                                              |
|                       Self-hosted runner registration                        |
|                                                                              |
--------------------------------------------------------------------------------

Invalid configuration provided for url. Terminating unattended configuration.
An error occurred: Not configured. Run config.(sh/cmd) to configure the runner.
```
2022-11-10 13:31:22 -08:00
Manu Bretelle 8e83820e40 Update README.md with PR feedback 2022-11-10 13:31:22 -08:00
Manu Bretelle da04c0609f Fix trailing space in .github/workflows/deploy.yml 2022-11-10 13:31:22 -08:00
Manu Bretelle a283b1d8d0 Update README to document APP_ID/APP_PRIVATE_KEY
Document the new environment variables and highlight the possible
security risk and provide possible mitigations.
2022-11-10 13:31:22 -08:00
Manu Bretelle 516f8f96ac Copy app_token.sh when building the docker image 2022-11-10 13:31:22 -08:00
Manu Bretelle a43f59ceb9 Add suport for using a GitHub app to run the runner.
If both `APP_ID` and `APP_PRIVATE_KEY` are set, `entrypoint.sh` will
fetch an `ACCESS_TOKEN` for the GitHub app using `app_token.sh` script.

`ACCESS_TOKEN` will get set, and `entrypoint.sh` will carry on as it
used to had `ACCESS_TOKEN` been set from the environment variable.
2022-11-10 13:31:22 -08:00
Manu Bretelle ec64392f58 Add a script to fetch an access token for a Github App.
This script will fetch an access token from Github for a Github app.

It is expected that `APP_ID` and `APP_PRIVATE_KEY` environment variables are set.

Running
```
APP_ID=12345 APP_PRIVATE_KEY="$(</path/to/githubapp.pem)" bash ./app_token.sh
```

will generate a token suitable to use as `ACCESS_TOKEN`.
2022-11-10 13:31:22 -08:00
Marcus Young 000e4c0e03 [Automated 🤖 ] Bump to version 2.299.1 2022-11-02 20:06:22 -04:00
Marcus Young ccad12634b [Automated 🤖 ] Bump to version 2.299.0 2022-11-02 15:10:20 -04:00
Marcus Young adff5c97f3 Sid is now bookworm in lsb_release -cs 2022-10-31 10:03:36 -05:00
Marcus Young e44424c8b9 [Automated 🤖 ] Bump to version 2.298.2 2022-10-04 11:52:15 -05:00
Marcus Young f60efe84a9 [Automated 🤖 ] Bump to version 2.298.1 2022-10-04 10:36:00 -05:00
Marcus Young e3f7748492 [Automated 🤖 ] Bump to version 2.298.0 2022-10-04 07:27:21 -05:00
myoung34andGitHub 0f2883e196 Merge pull request #250 from chantra/fix_ephemeral
Fix ephemeral support
2022-10-02 08:31:55 -05:00
chantra 2fc9c11800 Fix ephemeral support
The quotes added in 08608da938 cause
`ephemeral` to evaluate as false when `DISABLE_AUTO_UPDATE` was not set.

This is explained in details in #249. This diff changes the logic to use
an array where extra parameters are being added.
When calling config.sh, the array is expanded.

Testing:
../self_hosted_runner.env contains
```
EPHEMERAL=true
```

Before: https://gist.github.com/chantra/443dfaa60d964d938bcb1c020781ca00
we can see multiple jobs got scheduled on the runner

After: https://gist.github.com/chantra/061dc471c63964c01a2e3733a53bd3ec
we can see that when the job finished, the container shutdown.

After with DISABLE_AUTO_UPDATE set: https://gist.github.com/chantra/df0102c7340b8f6bfd458ec56d9fa29c

Also adding `set -x` before the call to `config.sh` revealed the
arguments were correctly added.

Fixes #249
2022-09-30 14:49:04 -07:00
Marcus Young dafb91bfa3 Hotfix: more lenient sid to bullseye sub 2022-09-28 01:48:12 -05:00
Marcus Young c3c6a4e493 Fix ghcli installer by using API and not html parsing 2022-09-26 12:08:03 -05:00
Marcus Young 087e754f56 Fix permissions for release creation 2022-09-26 11:27:59 -05:00
Marcus Young 5b19b8dafa [Automated 🤖 ] Bump to version 2.297.0 2022-09-26 10:54:33 -05:00
Marcus Young f4ac990ab1 Port ghcr to latest build 2022-09-16 11:21:21 -05:00
Marcus Young a3bcbecef1 Force a latest release build 2022-09-16 11:14:02 -05:00
myoung34andGitHub 26245f5fb3 Merge pull request #245 from jkroepke/patch-1
Add ghcr.io as image mirror
2022-09-16 11:07:26 -05:00
Jan-Otto KröpkeandGitHub 5a85c6bc92 Add ghcr.io as image mirror 2022-09-16 08:27:22 +02:00
myoung34andGitHub e77cb92da3 Merge pull request #242 from myoung34/test_on_pr
Test on pr
2022-09-12 10:56:05 -05:00
Marcus Young 4b56b45734 Test on pr 2022-09-12 10:55:17 -05:00
myoung34andGitHub 0a895b9bbe Merge pull request #241 from myoung34/contributing
add contributing.md
2022-09-12 10:51:40 -05:00
Marcus Young b8d4598b96 add contributing.md 2022-09-12 10:48:14 -05:00
myoung34andGitHub 1d440a09e9 Merge pull request #240 from myoung34/chown_optimization
Chown optimization
2022-09-12 09:10:45 -05:00
Marcus Young 91be52197d remove unnecessary echo from workflow 2022-09-10 19:49:06 -05:00
Marcus Young 650aeba07c Fix typos 2022-09-10 19:32:13 -05:00
Marcus Young 395d555a98 Fix workflow name 2022-09-10 19:24:14 -05:00
Marcus Young 08608da938 shellcheck entrypoint.sh 2022-09-10 19:23:25 -05:00
Marcus Young 6b686411c7 Set up pre-commit 2022-09-10 19:21:17 -05:00
Marcus Young 325fe76ae4 Add chown optimization, set up shellcheck 2022-09-10 19:08:40 -05:00
Marcus Young a6a57d36ab [Automated 🤖 ] Bump to version 2.296.2 2022-09-08 12:46:35 -05:00
myoung34andGitHub de41bc7f8b Merge pull request #234 from Rumbles/master
Check to see if not running as root
2022-09-06 19:41:53 -05:00
myoung34andGitHub c253d823a6 Merge pull request #238 from nmalaguti/feature/github-cli-gpg-key-problem
Change gh cli install method to github releases
2022-09-06 19:24:04 -05:00
Nick Malaguti 214b75489b Change gh cli install method to github releases
The apt repo for the gh cli is broken due to an expired GPG key:
https://github.com/cli/cli/issues/6175

They want to retire the debian packaging altogether
https://github.com/cli/cli/issues/5941 and this is the recommended "long
term" solution
https://github.com/cli/cli/issues/6175#issuecomment-1235984381.

Adapted from https://github.com/cli/cli/issues/6175#issuecomment-1236264607

Fixes #236
2022-09-06 09:59:23 -04:00
James Stocker 2cffdf6b9a Update logic at the end as requested 2022-09-02 12:26:29 +02:00
a779a7f993 Update entrypoint.sh
Co-authored-by: myoung34 <myoung34@my.apsu.edu>
2022-09-02 12:23:31 +02:00
217117d3bc Update entrypoint.sh
Co-authored-by: myoung34 <myoung34@my.apsu.edu>
2022-09-02 12:23:22 +02:00
829c6ccd91 Update entrypoint.sh
Co-authored-by: myoung34 <myoung34@my.apsu.edu>
2022-09-02 12:23:16 +02:00
d414c3a388 Update entrypoint.sh
Co-authored-by: myoung34 <myoung34@my.apsu.edu>
2022-09-02 12:22:36 +02:00
Marcus Young 28cb729624 [Automated 🤖 ] Bump to version 2.296.1 2022-08-31 12:45:45 -05:00
James Stocker 733ff44be5 Check to see if not running as root
Change logic slightly avoid edge case
2022-08-30 10:22:25 +02:00
myoung34andGitHub 0f9d476978 Merge pull request #179 from jarrett-confrey/feat/add-gh-cli
feat: add github cli (gh)
2022-08-29 13:43:48 -05:00
jarrett-confrey 6d189b3bae feat: add github cli (gh) 2022-08-29 11:04:46 -07:00
Marcus Young 36d8efe0c3 [Automated 🤖 ] Bump to version 2.296.0 2022-08-23 09:57:53 -05:00
myoung34andGitHub 9afc3108fc Merge pull request #231 from nikeee/master
Add git-lfs to base image
2022-08-17 09:27:15 -05:00
cc396abd59 Update Dockerfile.base
Co-authored-by: myoung34 <myoung34@my.apsu.edu>
2022-08-17 16:19:18 +02:00
Niklas MollenhauerandGitHub e8ff100cc0 Add git-lfs to base image
Using the checkout action with `lfs: true` currently fails with the error: 
```
Unable to locate executable file: git-lfs.
```

See: https://git-lfs.github.com
2022-08-17 13:54:58 +02:00
Marcus Young 3d2c69648f [Automated 🤖 ] Bump to version 2.295.0 2022-08-10 09:54:08 -05:00
Marcus Young bc2c03d8c9 Dont run as non-root by default 2022-08-01 16:52:32 -05:00
myoung34andGitHub 51125e863e Merge pull request #226 from marcus-bcl/patch-1
Set ownership of /opt/hostedtoolcache
2022-07-27 09:47:23 -05:00
Marcus AspinandGitHub 18afadab14 Set ownership of /opt/hostedtoolcache 2022-07-27 15:45:02 +01:00
Marcus Young ab8b9d7e6b Fix sudoers for runner user 2022-07-27 07:53:48 -05:00
Marcus Young b9622cc4e7 Last changes for run-as runner user 2022-07-26 12:07:03 -05:00
myoung34andGitHub 62a7a5f10c Merge pull request #223 from marcus-bcl/master
Run as non-root user by default
2022-07-26 11:47:59 -05:00
Marcus AspinandGitHub 36f4ed430a Merge pull request #1 from myoung34/user_fixes
Swap USER directive for gosu for runtime permissions
2022-07-26 16:31:32 +01:00
Marcus Young a257b7ad38 Guarantee base dirs for -u runner 2022-07-26 10:27:48 -05:00
Marcus Young ba8c7f86a9 Move user add to docker base 2022-07-26 09:55:51 -05:00
Marcus Young cda2ba1fb4 Swap USER directive for gosu for runtime permissions 2022-07-26 09:44:02 -05:00
Marcus Aspin 8d4afae3d2 Move entrypoint after user-creation 2022-07-26 08:20:40 +01:00
myoung34andGitHub 96aaa5c17c Merge pull request #224 from Uzlopak/remove-awscliv2.zip
remove awscliv2.zip after unzipping
2022-07-25 12:25:43 -05:00
uzlopak 5e529f979a remove awscliv2.zip after unzipping 2022-07-25 10:59:53 +02:00
Marcus Aspin f6da106489 Add runner user to group 121, and mark as system user 2022-07-25 09:23:30 +01:00
Marcus Aspin d2a3df72e6 Run as non-root user by default 2022-07-22 15:05:33 +01:00
Marcus Young 133c12574c Remove temporary workaround for liblttng-ust0/1 https://github.com/actions/runner/issues/1584 2022-06-22 11:31:46 -05:00
Marcus Young e376daf19c [Automated 🤖 ] Bump to version 2.294.0 2022-06-22 11:15:15 -05:00
myoung34andGitHub e729e6c6d4 Update README.md 2022-06-16 20:32:28 -05:00
Marcus Young 4064635fcd Restore latest to focal vs jammy 2022-06-16 16:23:42 -05:00
Marcus Young 11c9fcc196 [Automated 🤖 ] Bump to version 2.293.0 2022-06-10 09:03:27 -05:00
myoung34andGitHub 1807dca61a Merge pull request #214 from myoung34/rsync
add rsync
2022-06-07 21:11:57 -05:00
Marcus Young d4b0627097 add rsync 2022-06-07 21:10:58 -05:00
Marcus Young 12756a2db9 Fix double quotes for ORG interpolation 2022-06-07 19:59:28 -05:00
Marcus Young 6d52ecde6d Fix README 2022-06-07 19:36:20 -05:00
Marcus Young b62b07ddc7 Purge armv7, fix ubuntu matrix 2022-06-07 19:29:23 -05:00
myoung34andGitHub 648a8193a9 Merge pull request #213 from myoung34/wiki
refactor workflows, start moving to wiki
2022-06-07 17:25:59 -05:00
Marcus Young 597c9c5a89 refactor workflows, start moving to wiki 2022-06-07 16:49:25 -05:00
myoung34andGitHub 86c4382bd7 Merge pull request #211 from Ru13en/master
Upgrade docker image to latest LTS version (jammy)
2022-06-07 15:41:01 -05:00
Ruben RodriguesandGitHub 2ae9b3723e Update Dockerfile.base 2022-06-07 03:13:04 +01:00
Ruben RodriguesandGitHub e009ebcfc4 Update Dockerfile.base 2022-06-07 03:07:40 +01:00
Ruben RodriguesandGitHub cb37a448df Merge branch 'master' into master 2022-06-07 02:25:19 +01:00
Ruben RodriguesandRuben Rodrigues 60a36401e8 Upgrade docker image to latest LTS version (jammy) 2022-06-07 02:16:10 +01:00
myoung34andGitHub 3bb009e315 Merge pull request #210 from Ru13en/master
Add support for buildah-build and podman-push actions
2022-06-02 15:46:04 -04:00
Ruben RodriguesandGitHub faac4c020d Add missing buildah and skopeo 2022-06-02 20:22:56 +01:00
Ruben RodriguesandGitHub 1772a92395 Add podman/buildah/skopeo to base image 2022-06-02 20:15:19 +01:00
Marcus Young 0479f7d7b1 [Automated 🤖 ] Bump to version 2.292.0 2022-05-23 10:26:37 -05:00
myoung34andGitHub fe55a59385 Merge pull request #207 from joeyparrish/ephemeral2
fix: Simplify ephemeral runner setup
2022-05-10 19:32:39 -05:00
Joey Parrish dd69bd9dcc fix: Simplify ephemeral runner setup
The entrypoint script ephemeral-runner.sh is no longer required.  This
removes the script and updates the docs with a simpler recommended
setup.

This is the same setup my team is using in our lab at Google on 6
different hosts.
2022-05-10 13:10:33 -07:00
Marcus Young 7f896c8f56 [Automated 🤖 ] Bump to version 2.291.1 2022-04-29 10:03:20 -05:00
Marcus Young 566dd9110c [Automated 🤖 ] Bump to version 2.291.0 2022-04-29 07:01:05 -05:00
myoung34andGitHub aa7d3b39e3 Update README.md 2022-04-27 12:36:27 -05:00
Marcus Young 751e6dfae4 Revert back to 2.290.1 2022-04-20 17:56:11 -05:00
Marcus Young 5eb3642bd3 [Automated 🤖 ] Bump to version 2.289.3 2022-04-19 15:38:15 -05:00
myoung34andGitHub bfab79fc5d Update README.md 2022-04-18 15:11:54 -05:00
myoung34andGitHub 528dfd3b2d Merge pull request #202 from myoung34/hotfix/deregestration
Fix de-registration
2022-04-18 09:49:54 -05:00
Marcus Young 95cd8d9835 Fix de-registration 2022-04-18 09:49:38 -05:00
Marcus Young 825fa07289 [Automated 🤖 ] Bump to version 2.290.1 2022-04-14 09:50:16 -05:00
myoung34andGitHub 8c2635fb48 Merge pull request #200 from Firefishy/fix-ga-build-issue
Fix github action environment handling
2022-04-14 07:26:17 -05:00
Grant Slater f3ce751087 Fix github action environment handling 2022-04-14 13:24:49 +01:00
myoung34andGitHub 501dffaa90 Merge pull request #194 from Firefishy/upgrade-github-actions
Clean-up github actions to use official actions
2022-04-14 06:58:48 -05:00
Marcus Young 04145dad12 [Automated 🤖 ] Bump to version 2.290.0 2022-04-12 10:04:32 -05:00
myoung34andGitHub 744edabaa2 Merge pull request #195 from myoung34/fix_auto_update
Fix disable auto update
2022-04-01 21:55:00 -05:00
Marcus Young 8604248edf Fix disable auto update 2022-04-01 21:54:08 -05:00
Marcus Young 5727df6463 [Automated 🤖 ] Bump to version 2.289.2 2022-03-30 09:38:48 -05:00
Grant Slater 500dae91a3 Clean-up github actions to use official actions 2022-03-23 22:03:15 +00:00
Marcus Young 9a4c9687b6 [Automated 🤖 ] Bump to version 2.289.1 2022-03-18 13:48:30 -05:00
Marcus Young 22da74a53e [Automated 🤖 ] Bump to version 2.289.0 2022-03-18 10:44:08 -05:00
Marcus Young eba879f8a8 [Automated 🤖 ] Bump to version 2.288.1 2022-02-28 13:18:07 -06:00
Marcus Young 5aa59da8ca [Automated 🤖 ] Bump to version 2.288.0 2022-02-28 13:17:39 -06:00
myoung34andGitHub 742cae3439 Update README.md 2022-02-23 21:24:40 -06:00
myoung34andGitHub f85e5be0ba Merge pull request #189 from ikari7789/patch-1
Add proxy env variable passthru on sudo
2022-02-17 19:49:09 -06:00
Andrew Miller bb4285357f Use .* instead of ' ' for find/replace in sudoers 2022-02-18 10:23:10 +09:00
Andrew MillerandAndrew Miller 9828ae64b1 Add proxy env variable passthru on sudo
If you use "sudo" in the workflow file while behind a proxy, the environment variables passed into the container on creation will be lost since sudo current resets the environment. Update /etc/sudoers to allow the *_proxy and *_PROXY variables to be passed thru so proxy configuration is not lost.
2022-02-17 13:34:45 +09:00
myoung34andGitHub ff360e9b08 Merge pull request #184 from myoung34/disable_auto_updates
Add DISABLE_AUTO_UPDATE flag to disable automatic updates
2022-02-03 09:31:22 -06:00
Marcus Young 89fd82e9f8 Add DISABLE_AUTO_UPDATE flag to disable automatic updates 2022-02-03 09:30:51 -06:00
Marcus Young 3ea2681c1c Add missing dependency for awscli fallback 2022-02-01 20:18:06 -06:00
myoung34andGitHub a3b283960b Merge pull request #183 from myoung34/fix_awscli
Fix awscli to have a fallback method
2022-02-01 17:29:22 -06:00
Marcus Young 2c8611c5b0 Fix awscli to have a fallback method 2022-02-01 16:51:34 -06:00
myoung34andGitHub 783f219932 Merge pull request #180 from MrKevinWeiss/pr/fix/readmesystemd
fix(README.md): Fix the service example
2022-01-30 21:22:17 -06:00
myoung34andGitHub ba2f46a524 Merge pull request #182 from wildone/master
Update readme
2022-01-30 21:14:58 -06:00
Max BarrassandGitHub 7dae856b52 Update README.md 2022-01-31 12:55:36 +11:00
Max BarrassandGitHub bbac066934 Update README.md 2022-01-31 12:54:09 +11:00
Marcus Young 75e6e523a6 [Automated 🤖 ] Bump to version 2.287.1 2022-01-27 15:28:54 -06:00
Kevin "Tristate Tom" WeissandGitHub 7881135a1a fix(README.md): Fix the service example
I was able to get everything up and running and it looks good aside from a small gotcha.

While setting up an ephemeral systemd service it seemed that I still needed to mount the `/var/run/docker.sock`.

I am a pretty big fan of copy pasta and this may save a few google queries for "cannot connect to the docker daemon at unix:///var/run/docker.sock. is the docker daemon running?"

I guess some issue with docker in docker.

Anyways, just wondering if it would be useful, no need to merge if it doesn't make sense.
2022-01-27 20:41:36 +01:00
Marcus Young b3b35f4a44 [Automated 🤖 ] Bump to version 2.287.0 2022-01-27 10:47:28 -06:00
myoung34andGitHub ddb748c2c4 Merge pull request #178 from MrKevinWeiss/pr/fix/oncedep
fix(ephemeral-runner): Replace once with ephemeral
2022-01-26 11:14:26 -06:00
Kevin "Tristate Tom" WeissandGitHub d46589c2c9 fix(ephemeral-runner): Replace once with ephemeral
When running the `ephemeral-runner.sh` there is a deprecation warning.
Better to solve it sooner than later...
```
Warning: '--once' is going to be deprecated in the future, please consider using '--ephemeral' during runner registration.
```
2022-01-26 14:45:09 +01:00
myoung34andGitHub 20afe92018 Merge pull request #177 from lauripiispanen/master
Update AWS CLI to v2
2022-01-24 15:38:48 -06:00
Lauri Piispanen 31c719a53e install AWS CLI v2 directly from AWS 2022-01-24 23:30:30 +02:00
Marcus Young 8810c62144 Fall back to stable repo for git 1.33 failed dependency on git-man 1.34 on bionic/bullseye non-amd64 2022-01-23 10:10:06 -06:00
Marcus Young a9269b40d3 Deprecate debian buster support. Its wildly terrible on packaging currently 2022-01-20 09:15:47 -06:00
Marcus Young f9a9d2e9f8 Hotfix: fix PPA for debian 2022-01-20 09:00:05 -06:00
Marcus Young e2bc04b98d Fix gpg key add ordering 2022-01-19 15:02:52 -06:00
Marcus Young d63b95e11a Add GPG key for git-core ppa 2022-01-19 15:00:13 -06:00
myoung34andGitHub 522edf977c Merge pull request #174 from myoung34/git_ppa
Use git-core PPA for git
2022-01-19 14:55:59 -06:00
Marcus Young 1fce1c1693 Use git-core PPA for git 2022-01-19 14:55:14 -06:00
myoung34andGitHub 3c45869076 Merge pull request #168 from myoung34/liblttng
Fix liblttng-ust[0-1]
2022-01-19 08:19:27 -06:00
Marcus Young 3267910888 Add temporary workaround 2022-01-19 08:18:44 -06:00
Marcus Young 032d5c358f [Automated 🤖 ] Bump to version 2.286.1 2022-01-14 11:11:35 -06:00
myoung34andGitHub 46259e4d1e Merge pull request #171 from jensbaitingerbosch/patch-2
Added chapter about proxy support
2022-01-07 08:01:30 -06:00
Jens BaitingerandGitHub c7c7a89cb0 Added chapter about proxy support 2022-01-07 11:31:27 +01:00
myoung34andGitHub 111dfab468 Merge pull request #170 from jensbaitingerbosch/patch-1
fixing HTTP/1.1 411 Length Required
2022-01-06 10:56:12 -06:00
Jens BaitingerandGitHub c0539dfb0e fixing HTTP/1.1 411 Length Required
Somehow our Github enterprise server returns 411 when the "Content-Lenght" header is not set. 

The complete error message is (using curl -v): 
```
HTTP/1.1 411 Length Required
< Content-Type: text/html; charset=us-ascii
< Server: Microsoft-HTTPAPI/2.0
< Date: Thu, 06 Jan 2022 15:36:55 GMT
< Connection: close
< Content-Length: 344
<
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Length Required</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Length Required</h2>
<hr><p>HTTP Error 411. The request must be chunked or have a content length.</p>
</BODY></HTML>
```

By setting this Header explicitely, this error does no longer occur.
2022-01-06 16:51:42 +01:00
Marcus Young 179c64b117 Fix liblttng-ust[0-1] 2022-01-03 21:22:01 -06:00
Marcus Young a3bfdb6798 [Automated 🤖 ] Bump to version 2.286.0 2021-12-21 10:09:57 -06:00
Marcus Young 2fb64e21af Add docs around auto update 2021-12-13 10:53:14 -06:00
Marcus Young 1859a7f9f0 Fix typo in docker image name in readme 2021-12-13 10:40:51 -06:00
Marcus Young 75fe1ec298 [Automated 🤖 ] Bump to version 2.285.1 2021-12-06 11:01:30 -06:00
Marcus Young 0b94c32395 [Automated 🤖 ] Bump to version 2.285.0 2021-11-29 10:31:01 -06:00
myoung34andGitHub 84d2ccdb6c Merge pull request #162 from Kesin11/fix_configure_command_no_ephemral
Fix configure command when EPHEMERAL is disabled
2021-11-27 06:49:12 -06:00
Kenta KaseandGitHub 073a18840d Fix configure command when EPHEMERAL is disabled 2021-11-27 18:09:11 +09:00
myoung34andGitHub 569fdcef42 Merge pull request #161 from Kesin11/support_ephemeral_option
Support --ephemeral option
2021-11-24 09:38:46 -06:00
Kenta KaseandGitHub 197ded45fb Add docs for 'EPHEMERAL' ENV 2021-11-24 09:25:15 +09:00
Kenta KaseandGitHub 63b7a683ad Support --ephemeral runner option 2021-11-24 09:18:49 +09:00
Marcus Young 12755b572f [Automated 🤖 ] Bump to version 2.284.0 2021-11-01 10:37:01 -05:00
Marcus Young e4b56c3d76 [Automated 🤖 ] Bump to version 2.283.3 2021-10-04 14:14:55 -05:00
Marcus Young b91ff43474 [Automated 🤖 ] Bump to version 2.283.2 2021-09-30 08:04:43 -05:00
myoung34andGitHub 3e5e6de819 Merge pull request #150 from gazab/patch-1
Fix small typo in entrypoint.sh log output
2021-09-22 07:30:19 -05:00
Gustav TonérandGitHub d0da2268ee Fix typo in entrypoint.sh log output 2021-09-22 13:24:20 +02:00
Marcus Young fbc204bc10 [Automated 🤖 ] Bump to version 2.283.1 2021-09-20 09:06:26 -05:00
Marcus Young 162cb1f201 [Automated 🤖 ] Bump to version 2.283.0 2021-09-20 08:21:05 -05:00
Marcus Young 0e38dc10ce [Automated 🤖 ] Bump to version 2.282.1 2021-09-15 13:04:58 -05:00
myoung34andGitHub dd77bee9a9 Merge pull request #149 from myoung34/signals
Fix deregistration hijacking
2021-09-15 10:26:18 -05:00
Marcus Young c837c99a7b Fix deregistration hijacking 2021-09-15 10:23:46 -05:00
myoung34andGitHub 10b21dfc71 Merge pull request #141 from joeyparrish/deregistration
Fix runner deregistration with ACCESS_TOKEN
2021-09-15 10:22:25 -05:00
myoung34andGitHub e386012396 Merge branch 'master' into deregistration 2021-09-15 08:31:07 -05:00
myoung34andGitHub 4df911ff4b Merge pull request #145 from Niek/master
Fix #142 - building on Sid
2021-09-15 08:29:28 -05:00
myoung34andGitHub d75627b94e Merge pull request #143 from JulianGro/update_debian
Update Debian README information
2021-09-15 08:19:45 -05:00
myoung34andGitHub 2aa12337bb Merge pull request #146 from JulianGro/fix_locale
Properly enable locale
2021-09-15 08:19:12 -05:00
myoung34andGitHub 37ffbfad94 Merge pull request #147 from lukaszjankowski/fix-typo
Fix typo in entrypoint.sh
2021-09-15 08:17:53 -05:00
Łukasz JankowskiandGitHub 9bf27c4aac Update entrypoint.sh 2021-09-14 11:20:43 +02:00
Julian Groß 3cbb4714a8 Properly enable locale 2021-09-13 23:58:46 +02:00
Marcus Young 85d2ef126b [Automated 🤖 ] Bump to version 2.282.0 2021-09-13 13:17:21 -05:00
Niek van der MaasandGitHub c9b0931b5a Merge branch 'myoung34:master' into master 2021-09-13 12:35:32 +02:00
Niek van der Maas 450ab99ee9 Fix Sid support 2021-09-13 12:35:12 +02:00
Julian Groß 4006da573c Update Debian README as Debian Bullseye has been released as stable. 2021-09-11 03:35:30 +02:00
myoung34andGitHub b11f137e68 Merge pull request #140 from joeyparrish/ephemeral
feat: Ephemeral mode
2021-09-10 11:17:06 -05:00
53089f4326 Accept maintainer's suggestion in README
Co-authored-by: myoung34 <myoung34@my.apsu.edu>
2021-09-10 12:16:06 -04:00
Joey Parrish 844d91507d Add docs for ephemeral mode 2021-09-10 09:08:35 -07:00
Joey Parrish 816a1c181f Fix runner deregistration with ACCESS_TOKEN
This fixes runner deregistration, which needs to have ACCESS_TOKEN still
defined to fetch a fresh RUNNER_TOKEN for deregistration.

The original purpose of unsetting the variables would seem to be for
security, to make sure they unavailable to the jobs running in the
container. Unexporting the variables achieves the same goal, but leaves
them available to the entrypoint later when it runs the deregistration
process.
2021-09-10 08:56:00 -07:00
Joey Parrish ced39230ac feat: Ephemeral mode 2021-09-10 08:49:45 -07:00
Marcus Young fdd8a7d93a [Automated 🤖 ] Bump to version 2.281.1 2021-09-01 15:34:45 -05:00
Marcus Young 745904194f [Automated 🤖 ] Bump to version 2.281.0 2021-08-30 12:32:46 -05:00
Marcus Young 37adeae591 [Automated 🤖 ] Bump to version 2.280.3 2021-08-19 08:26:40 -05:00
Marcus Young f87f07f8f9 [Automated 🤖 ] Bump to version 2.280.2 2021-08-12 12:44:46 -05:00
myoung34andGitHub 9ed686442d Merge pull request #134 from joeyparrish/install-python2
Make python2 the default python version
2021-08-04 15:39:01 -05:00
Joey Parrish 20e2344ae0 Make python2 the default python version
It turns out that the "python2" package in Ubuntu doesn't touch
/usr/bin/python.  To get /usr/bin/python pointing to /usr/bin/python2,
you are supposed to install the "python" package.  I didn't realize this
when I made PR #132, and I didn't test thoroughly enough with my own
workflows to realize my mistake.

This corrects the package name to "python", making python2 the default.
2021-08-04 13:34:39 -07:00
Marcus Young 2991edd770 [Automated 🤖 ] Bump to version 2.280.1 2021-08-04 12:40:12 -05:00
myoung34andGitHub 70cfc22566 Merge pull request #133 from joeyparrish/fix-chmod
Fix failing chmod on docker-compose on arm
2021-08-04 11:33:42 -05:00
myoung34andGitHub 00824687a7 Merge pull request #132 from joeyparrish/install-python2
Add python2 to base image
2021-08-04 11:31:14 -05:00
Joey Parrish 746ef939c5 Fix failing chmod on docker-compose on arm
Since docker-compose is not downloaded on arm, the chmod command fails
there.  Moving it inside the previous command, after curl, ensures it
only runs when it should.
2021-08-04 09:31:05 -07:00
Joey Parrish 30ff3b9560 Add python2 to base image
Since GitHub Actions environments include python2, this improves
compatibility for the docker image.
2021-08-04 08:55:21 -07:00
myoung34andGitHub 69daab6ad2 Merge pull request #127 from joeyparrish/comment-git-source-build
Add a comment about why git is built from source
2021-08-03 16:42:30 -05:00
Joey Parrish e60f5986bb Add a comment about why git is built from source
Closes #125
2021-08-03 14:39:46 -07:00
Marcus Young 29cbe17895 [Automated 🤖 ] Bump to version 2.280.0 2021-08-03 10:35:37 -05:00
myoung34andGitHub b4ba78cd21 Merge pull request #124 from khancyr/patch-1
Installing jq once is enough
2021-07-30 16:56:29 -05:00
Pierre KancirandGitHub d2d66f3d22 Installing jq once is enough
duplicate jq in apt-get install
2021-07-30 23:38:21 +02:00
Marcus Young 5995ad0f01 Simplify runner reusage, add some output to show logic. Fix readme 2021-07-22 21:15:31 -05:00
myoung34andGitHub fb255ab34b Merge pull request #117 from NickVeld/runner-reusage
Runner reusage
2021-07-22 20:49:32 -05:00
Marcus Young 7d14c7aedd [Automated 🤖 ] Bump to version 2.279.0 2021-07-21 10:58:32 -05:00
Marcus Young a01a429a16 Set up base to build on base yml changes 2021-07-21 09:48:30 -05:00
myoung34andGitHub d19d7c4537 Merge pull request #123 from Niek/master
Add Debian bullseye/sid support
2021-07-21 09:26:07 -05:00
Niek van der MaasandGitHub a096478374 Fix bullseye link 2021-07-21 15:19:36 +01:00
58ee5ef39f Update archs
Co-authored-by: Julian Groß  <julian.g@posteo.de>
2021-07-21 11:43:02 +01:00
c3ca3aee45 Uodate archs
Co-authored-by: Julian Groß  <julian.g@posteo.de>
2021-07-21 11:42:27 +01:00
9e8f4c2c78 Update archs
Co-authored-by: Julian Groß  <julian.g@posteo.de>
2021-07-21 11:42:11 +01:00
Niek van der MaasandGitHub 529d0654e6 Add Bullseye 2021-07-21 08:51:30 +00:00
5b64b6fad7 Add unstable warning
Co-authored-by: Julian Groß  <julian.g@posteo.de>
2021-07-21 09:48:54 +01:00
Niek van der MaasandGitHub f0f4f7d8bc Added fail-fast false 2021-07-21 08:47:52 +00:00
Niek van der MaasandGitHub 0015ccd295 Add Debian sid 2021-07-21 07:26:28 +00:00
myoung34andGitHub a976891559 Merge pull request #122 from dkaoster/debian-buster-armv7
Add Debian Buster armv7
2021-07-19 16:08:24 -05:00
Daniel Kao c210772313 Add Debian Buster armv7 2021-07-19 14:03:19 -07:00
myoung34andGitHub ef0bc0645e Merge pull request #121 from BretFisher/patch-1
add more info to docker warning to README
2021-07-16 16:16:14 -05:00
Bret FisherandGitHub 91fb9c4fd6 add more info to docker warning 2021-07-16 17:13:32 -04:00
myoung34andGitHub 5eb1ede626 Merge pull request #119 from JulianGro/debian_buster
Add Debian Buster
2021-07-15 14:52:40 -05:00
Julian Groß 6dbc298ab4 Don't use gnupg-agent transitional package as it is no longer needed 2021-07-15 20:48:31 +02:00
Julian Groß 03aebc7810 Merge remote-tracking branch 'refs/remotes/origin/master'
Conflicts:
	.github/workflows/base.yml
	.github/workflows/deploy.yml
	.github/workflows/release.yml
	README.md
2021-07-15 20:46:39 +02:00
NickVeld 20af46178d entrypoint: "return" -> "if-else" logic 2021-07-15 19:38:43 +03:00
myoung34andGitHub 9181c228fd Merge pull request #120 from myoung34/remove_xenial
Remove Xenial (past EOL)
2021-07-15 10:02:26 -05:00
Marcus Young 12b1b33f98 Remove Xenial (past EOL) 2021-07-15 10:02:11 -05:00
Julian Groß 86edf34f33 Go back to transitional package for xenial 2021-07-08 15:27:05 +02:00
Julian Groß 0d7ab6ad6b Download the right files for debian buster. 2021-07-08 08:07:04 +02:00
Julian Groß 7fc53eaa8c Switch from transitional package gnupg-agent to gpg-agent.
Install gnupg as it is needed for apt-key.
2021-07-08 07:58:46 +02:00
NickVeld d51a7b1fdd entrypoint: SC2068 fixed, func name fixed 2021-07-07 17:16:58 +03:00
NickVeld c0ed88f355 README: CONFIGURED_ACTIONS_RUNNER_FILES_DIR definition redesign 2021-07-07 17:15:25 +03:00
Julian Groß aa150eb6b2 Add Debian Buster 2021-07-06 23:56:20 +02:00
NickVeld 564b04aace entrypoint: fi remove 2021-07-01 08:21:07 +03:00
NickVeld f0b31cfa18 entrypoint: explicit set with default, command exec into another func 2021-07-01 08:15:18 +03:00
NickVeld 9e991ad064 README: extract CONFIGURED_ACTIONS_RUNNER_FILES_DIR in example 2021-07-01 08:11:49 +03:00
NickVeld 7256a0acb5 shellcheck passing 2021-06-27 06:31:01 +03:00
NickVeld f06920ae43 README: variable and example for runner reusage 2021-06-25 06:00:09 +03:00
NickVeld ae1dfe0585 Dockerfile, entrypoint: runner-reusage base 2021-06-25 05:36:26 +03:00
myoung34andGitHub 30c4470861 Merge pull request #115 from nipeharefa/fix/image-name
fix: image name
2021-06-12 06:56:21 -05:00
Nipe Setiawan Harefa 57580c131b fix image name 2021-06-12 18:37:44 +07:00
myoung34andGitHub db197d1475 Merge pull request #114 from chrisedebo/patch-1
Update README.md
2021-06-11 09:13:15 -05:00
Chris NicelandGitHub 92c01bb28b Update README.md
Typo correction
2021-06-11 15:09:36 +01:00
Marcus Young fb4f85cf74 Deprecate ORG_RUNNER 2021-06-03 09:33:03 -05:00
Marcus Young 839e0e0397 Remove eoan from readme 2021-06-03 09:27:52 -05:00
myoung34andGitHub b76d3b8a2a Merge pull request #111 from jakubstefan/enterprise-scope
Add compatibility with enterprise-wide runners
2021-06-03 09:26:04 -05:00
Lucas Santisteban 856296f324 Select scope in a single variable
The backwards compatibility with ORG_RUNNER is ensured. If
RUNNER_SCOPE is present, it overrides what is imposed by ORG_RUNNER.
2021-06-01 11:32:11 +02:00
Lucas Santisteban e4a4891065 Add compatibility with enterprise-scoped runner
https://docs.github.com/en/enterprise-server@2.22/rest/reference/enterprise-admin#create-a-registration-token-for-an-enterprise
2021-05-14 20:19:02 +02:00
Marcus Young 7981379307 Feat: add -e to install_actions in case the install process fails
Resolves #110
2021-04-22 08:40:40 -05:00
Marcus Young 8bb6f8fbdc [Automated 🤖 ] Bump to version 2.278.0 2021-04-16 10:57:15 -05:00
myoung34andGitHub 389af18d80 Merge pull request #107 from nipeharefa/add-env
Add access token at env kube
2021-04-11 07:55:23 -05:00
Nipe Setiawan Harefa 18763f65a6 add access token at env kube 2021-04-11 19:04:45 +07:00
myoung34andGitHub 48446fa0eb Merge pull request #100 from myoung34/docker_compose_arm
Dont install broken docker-compose on ARM
2021-03-23 07:42:23 -05:00
myoung34andGitHub 808655bf8b Merge pull request #101 from myoung34/optional_deregistration
Add support for optional deregistration via DISABLE_AUTOMATIC_DEREGISTRATION flag
2021-03-23 07:32:33 -05:00
Marcus Young 7592c0e2c6 Add ability to override command in entrypoint 2021-03-23 07:31:27 -05:00
Marcus Young 6090cb38f9 Add support for optional deregistration via DISABLE_AUTOMATIC_DEREGISTRATION flag 2021-03-23 06:01:37 -05:00
Marcus Young d74f9103bf Dont install broken docker-compose on ARM 2021-03-23 05:50:49 -05:00
Marcus Young b22391ffca Add information about docker limitations 2021-03-23 05:16:04 -05:00
myoung34andGitHub e23a139a12 Merge pull request #93 from egyptianbman/patch-1
Install zstd
2021-03-11 05:44:19 -06:00
Beshoy GirgisandGitHub ff99e43a75 Install zstd
The following is printed in the debug log:
```
##[debug]Checking zstd --version
##[debug]Unable to locate executable file: zstd. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
```
2021-03-11 00:17:29 -06:00
myoung34andGitHub 174aeb3258 Merge pull request #89 from A-styler/patch-1
Merge layers
2021-03-02 18:55:02 -06:00
Dmitry TolstoyandGitHub 05609758f3 Merge layers
We can merge layers for less image size
2021-03-03 03:43:55 +03:00
myoung34andGitHub a1dd5f842d Merge pull request #88 from myoung34/awscliv2
Add awscliv2
2021-02-28 18:26:52 -06:00
Marcus Young 1932e3375b Add awscliv2 2021-02-28 18:24:56 -06:00
myoung34andGitHub 74ecb5a404 Merge pull request #82 from jonico/patch-1
Add your project to awesome-runners list
2021-02-16 09:46:23 -06:00
Johannes NicolaiandGitHub 14f96a18ff Add your project to awesome-runners list 2021-02-16 16:34:45 +01:00
Marcus Young ee685078f0 [Automated 🤖 ] Bump to version 2.277.1 2021-02-09 13:54:46 -06:00
Marcus Young d206b12c7e [Automated 🤖 ] Bump to version 2.277.0 2021-02-09 12:37:30 -06:00
Marcus Young d25b2c40aa Add more info to README about default value of GITHUB_HOST env var 2021-02-01 12:37:37 -06:00
myoung34andGitHub a6c246002d Merge pull request #81 from kdihalas/master
Add support for github enterprise
2021-02-01 12:26:17 -06:00
Kostas Dichalas 8a6b399cbf fix README 2021-02-01 18:09:11 +00:00
Kostas Dichalas 712198c4ae add support for Github Enterprise 2021-02-01 18:08:23 +00:00
Marcus Young 1c77e52852 Bump retry timeout to 2h 2021-01-26 20:31:48 -06:00
Marcus Young 3214ffcbd2 Wrap docker buildx build into a retry action 2021-01-24 20:16:36 -06:00
Marcus Young 811526bd09 [Automated 🤖 ] Bump to version 2.276.1 2021-01-21 13:33:04 -06:00
Marcus Young df4aafa18c [Automated 🤖 ] Bump to version 2.276.0 2021-01-15 08:26:59 -06:00
Marcus Young 06b9efcab8 [Automated 🤖 ] Bump to version 2.276.0 2021-01-15 08:24:53 -06:00
Marcus Young 8480c956b2 [Automated 🤖 ] Bump to version 2.276.0 2021-01-14 13:02:44 -06:00
myoung34andGitHub 6137ccae83 Merge pull request #78 from nstdio/locale
Add locale in Dockerfile.base
2020-12-27 07:59:07 -06:00
Edgar Asatryan 661a1824d1 Add locale in Dockerfile.base 2020-12-27 17:13:14 +04:00
myoung34andGitHub 54d513c5c7 Merge pull request #76 from Mongey/patch-1
Update nomad example
2020-12-17 21:09:33 -06:00
Conor MongeyandGitHub 046e3288a9 Update nomad example 2020-12-18 03:04:04 +00:00
Marcus Young 8e534f1b4a [Automated 🤖 ] Bump to version 2.275.1 2020-12-14 15:42:30 -06:00
Marcus Young b1dced691a Hotfix: remove space in TAG env var 2020-12-14 10:31:00 -06:00
Marcus Young c9946b6b31 [Automated 🤖 ] Bump to version 2.275.0 2020-12-14 10:21:11 -06:00
Marcus Young ac17cca755 Attempt trying to fix set-env disabling: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/ 2020-11-17 09:58:35 -06:00
Marcus Young bb19030a73 [Automated 🤖 ] Bump to version 2.274.2 2020-11-16 07:40:31 -06:00
Marcus Young 6213d66bcd [Automated 🤖 ] Bump to version 2.274.1 2020-11-09 08:30:50 -06:00
Marcus Young 1d5a155cc2 [Automated 🤖 ] Bump to version 2.274.0 2020-11-05 10:49:01 -06:00
Marcus Young a12ceeb0dd [Automated 🤖 ] Bump to version 2.274.0 2020-11-05 09:58:57 -06:00
Marcus Young ca70d18293 [Automated 🤖 ] Bump to version 2.274.0 2020-11-05 09:44:09 -06:00
myoung34andGitHub 06d8f4625d Merge pull request #71 from morihaya/readme-patch
fix: Kubernetes sample in README
2020-11-03 08:52:00 -06:00
morihaya a1281ef45c fix: Kubernetes sample in README 2020-11-03 23:07:17 +09:00
Marcus Young 9201778fad [Automated 🤖 ] Bump to version 2.273.6 2020-11-02 13:29:29 -06:00
Marcus Young bff29ac494 Revert docker-build-push action until a solution is found for it re-cloning and removing changes to the Dockerfile 2020-11-02 10:27:16 -06:00
Marcus Young e4be4ad005 Debug workflow 2020-11-02 09:29:31 -06:00
myoung34andGitHub 10017089e9 Merge pull request #69 from myoung34/platforms
Fix supported platforms
2020-11-02 09:23:43 -06:00
Marcus Young fa1de4a811 Fix supported platforms 2020-11-02 09:23:27 -06:00
myoung34andGitHub e17bf4910b Merge pull request #68 from myoung34/outputs
Use step outputs instead of env vars
2020-11-02 09:16:57 -06:00
Marcus Young d72e997be8 Use step outputs instead of env vars 2020-11-02 09:16:34 -06:00
myoung34andGitHub 76b0b01565 Merge pull request #67 from myoung34/syntax
Fix interpolation syntax
2020-11-02 08:53:20 -06:00
Marcus Young 42929b8d14 Fix interpolation syntax 2020-11-02 08:53:05 -06:00
myoung34andGitHub 594be32236 Merge pull request #66 from myoung34/fix_token
Fix user/pass
2020-11-02 08:49:34 -06:00
Marcus Young 952fa6436d Fix user/pass 2020-11-02 08:48:40 -06:00
myoung34andGitHub df396afc51 Merge pull request #65 from damacus/workflow/deploy
Update deploy & release workflows to use Docker Actions
2020-11-02 08:42:27 -06:00
Dan Webb 5ab9c36182 Update deploy & release workflows to use Docker Actions 2020-11-02 14:38:21 +00:00
myoung34andGitHub 123a06f31f Merge pull request #64 from damacus/base/update-workflow
Updates the base Dockerfile workflow to use Docker's GitHub Action
2020-11-02 08:36:47 -06:00
Dan Webb fa889767b2 Updates the base Dockerfile workflow to use Docker's GitHub Action
We now use the newer docker setup & build actions.
2020-11-02 14:02:35 +00:00
myoung34andGitHub 04f0651b9f Merge pull request #62 from damacus/configure/runner-group
Add the option to configure the RUNNER_GROUP on startup
2020-10-23 04:58:00 -05:00
myoung34andGitHub b7f8c8ffe7 Merge pull request #63 from damacus/update/base
Update docker-compose & git
2020-10-23 04:56:42 -05:00
Dan Webb bb7c15e231 Update docker-compose & git 2020-10-23 09:56:05 +01:00
Dan Webb bdfbe31f59 Add the option to configure the RUNNER_GROUP on startup
This adds the RUNNER_GROUP variable to configure which group the runner
is added to. Defaults to the "Default" runner group.
2020-10-23 09:43:24 +01:00
myoung34andGitHub 3e7ea713b6 Merge pull request #58 from Jorgen1040/readme-fix
Removed build from example docker-compose file
2020-10-09 18:10:37 -05:00
Jorgen1040 731f9b4d35 Removed build from example docker-compose file 2020-10-10 01:05:24 +02:00
myoung34andGitHub 6171bd339f Merge pull request #57 from nberrington-cloudian/support-setup-python
Add support for the setup-python action
2020-10-05 06:00:46 -05:00
Neil Berrington 8b2f017591 Add support for the setup-python action 2020-10-05 10:14:23 +01:00
Marcus Young 5396e6c1d7 [Automated 🤖 ] Bump to version 2.273.5 2020-10-02 11:05:34 -05:00
myoung34andGitHub 403f37aa99 Merge pull request #56 from pablosproject/master
Add openssh client
2020-09-28 09:46:07 -05:00
Paolo Tagliani 74563f9602 add openssh client 2020-09-28 16:35:47 +02:00
Marcus Young 8f5f35b0c6 Remove armv7 for focal because docker-ce deb is inconsistent 2020-09-18 09:03:13 -05:00
Marcus Young ad54eac81f Add --allow-unauthenticated to docker for armv7/arm64 reasons 2020-09-18 08:09:46 -05:00
Marcus Young 86a40ab6f5 Update dumb-init to work with special consideration for xenial (and dropped support for xenial armv7) 2020-09-18 07:56:17 -05:00
Marcus Young 42aca0e18c Add notes column to readme 2020-09-18 06:52:03 -05:00
Marcus Young 844b04fea7 Add specific apt-key import for docker 2020-09-18 06:49:25 -05:00
myoung34andGitHub 2af8cebe4d Merge pull request #54 from navarroaxel/patch-1
Fix Docker apt source for focal
2020-09-18 06:34:42 -05:00
Axel NavarroandGitHub bf8100e41f Fix Docker apt source for focal 2020-09-18 07:45:35 -03:00
myoung34andGitHub bacc2b46e1 Merge pull request #53 from myoung34/remove_eoan
remove eoan
2020-09-18 05:21:29 -05:00
Marcus Young 88bfb9c06c remove eoan 2020-09-18 05:18:42 -05:00
myoung34andGitHub c25bf7c2ed Merge pull request #52 from hintmedia/fix-deregistration-with-dumb-init
Fix deregistration with dumb-init
2020-09-17 17:33:42 -05:00
Benjamin Wood 18572ff629 Fix deregistration with dumb-init
This resolves the issue reported in #34 where deregistration fails
because docker is not passing SIGTERM to the entrypoint.
2020-09-17 15:27:41 -07:00
Marcus Young 65dce5c979 Bump to version 2.273.4 2020-09-17 13:25:30 -05:00
Marcus Young a8485e8339 Bump to version 2.273.3 2020-09-16 10:28:53 -05:00
Marcus Young 93357a7d27 Bump to version 2.273.2 2020-09-14 13:18:43 -05:00
Marcus Young f15dd52add Bump to version 2.273.2 2020-09-14 12:26:51 -05:00
Marcus Young c998ea371d Bump to version 2.273.1 2020-09-08 12:39:48 -05:00
Marcus Young f6ad6ef8a2 Add info on focal 2020-08-19 15:33:20 -05:00
Marcus Young e3231ab205 Force rebuild of base ami 2020-08-19 13:53:51 -05:00
Marcus Young 9c58db7a57 Remove arm/v7 from focal builds 2020-08-19 12:54:44 -05:00
Marcus Young c03e9ebf66 Rebuild base 2020-08-19 12:11:25 -05:00
myoung34andGitHub 11f175b8f9 Merge pull request #47 from damacus/add/focal
Build Focal (20.04) images
2020-08-19 12:08:11 -05:00
myoung34andGitHub b5291c758b Merge pull request #48 from myoung34/hotfix/org_runner_token_default_url
add org runner for runner token
2020-08-19 12:06:16 -05:00
Marcus Young 059387c11c add org runner for runner token 2020-08-19 12:05:44 -05:00
Dan Webb db30f47307 Build Focal (20.04) images 2020-08-19 16:26:18 +01:00
myoung34andGitHub 4e4cffbb08 Merge pull request #46 from damacus/compose-version
Update the docker-compose version
2020-08-19 10:23:02 -05:00
Dan Webb a99dfa793e Update the docker-compose version
Updates the docker-compose version from 1.25.4 to 1.26.2
The environment variable makes it easier install a newer version
2020-08-19 16:20:07 +01:00
Marcus Young bdc848c9a0 Bump to version 2.273.0 2020-08-19 09:53:13 -05:00
myoung34andGitHub 26ed21bcfc Merge pull request #44 from divlv/master
Notes regarding PAT scopes and privileges.
2020-08-06 13:52:32 -05:00
Dmitrijs ZaharovsandGitHub 5357aa869c Notes regarding PAT scopes and privileges. 2020-08-06 21:44:12 +03:00
Marcus Young d68d9f6fc8 Bump to version 2.272.0 2020-07-29 15:38:28 -04:00
myoung34andGitHub abd5a962b5 Create SECURITY.md 2020-07-28 10:55:08 -05:00
Marcus Young 7ccb4ed034 Update readme 2020-07-10 10:05:59 -05:00
myoung34andGitHub 531dbeab92 Merge pull request #40 from myoung34/actions_add
Add all workflows back
2020-07-06 07:51:16 -05:00
Marcus Young 814b400daf Add all workflows back 2020-07-06 07:50:48 -05:00
myoung34andGitHub c569803c05 Merge pull request #39 from myoung34/actions_remove
Trying fix for github actions cron mod
2020-07-06 07:49:44 -05:00
Marcus Young 57fd528ae9 Trying fix for github actions cron mod 2020-07-06 07:49:06 -05:00
Marcus Young fad3705687 Add scheduled builders 2020-07-05 20:18:54 -05:00
Marcus Young dbf917bdc9 Bump to version 2.267.1 2020-06-30 21:26:33 -05:00
Marcus Young 15bc90d41e Dummy commit to force latest rebuild 2020-06-29 15:27:35 -05:00
myoung34andGitHub 5f16e6caf2 Merge pull request #37 from Kreelio/feat/add-unzip
feat: add unzip to docker image
2020-06-29 13:29:23 -05:00
myoung34andGitHub c0b9c0300e Merge pull request #36 from aslafy-z/patch-1
fix(docs): quote boolean in docker-compose example
2020-06-29 13:29:00 -05:00
ZadkielandGitHub 4dc6700829 feat: add unzip to docker image 2020-06-29 20:19:31 +02:00
ZadkielandGitHub 3e492d23bd fix(docs): quote boolean in docker-compose example 2020-06-29 20:02:28 +02:00
Marcus Young d2f686e857 Bump to version 2.267.0 2020-06-23 13:42:18 -05:00
Marcus Young 18198af872 Fix docs a bit 2020-06-15 07:20:45 -05:00
myoung34andGitHub 03bd34f460 Merge pull request #31 from myoung34/develop
Optimize base
2020-06-12 09:26:06 -05:00
Marcus Young 210dcf0f84 Optimize base 2020-06-12 08:43:34 -05:00
Kevin JonesandGitHub fd49993401 Added RUNNER_WORKDIR mounting readme note
Fix for https://github.com/myoung34/docker-github-actions-runner/issues/27#issue-630231157
2020-06-03 12:22:58 -07:00
Marcus Young 1e12527d1b Fix deprecation warning for buildx-version 2020-05-31 15:17:45 -05:00
Marcus Young 7648aa4205 Add basic support for SIGTERM handling 2020-05-27 06:46:57 -05:00
Marcus Young 5c2992ba3f Fix _PROTO when repo_url not given 2020-05-27 06:13:53 -05:00
Marcus Young f0db7fd111 Actions hates me 2020-05-26 17:53:36 -05:00
Marcus Young 01aa45246c Add awscli into base 2020-05-26 17:52:36 -05:00
Marcus Young 3d44159889 Unset ACCESS_TOKEN|RUNNER_TOKEN after configure 2020-05-23 06:58:05 -05:00
Marcus Young 258480828a Add random default name with prefix 2020-05-21 16:26:51 -05:00
17 changed files with 857 additions and 433 deletions
+91 -51
View File
@@ -3,66 +3,106 @@ on:
push:
paths:
- Dockerfile.base
- .github/workflows/base.yml
branches:
- master
- develop
schedule:
- cron: '0 22 * * *'
jobs:
ubuntu_base_latest_deploy:
runs-on: ubuntu-latest
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- name: Get GitHub organization or user
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY})
- name: Set up Docker Buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Build
run: docker buildx build -f Dockerfile.base -t ${ORG}/github-runner-base:latest --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
ubuntu_base_bionic_deploy:
- name: Copy Repo Files
uses: actions/checkout@master
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.base
pull: true
push: true
tags: ${{ env.ORG }}/github-runner-base:latest
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
ubuntu_base_deploy:
runs-on: ubuntu-latest
strategy:
matrix:
release: [jammy, focal, bionic]
fail-fast: false
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- name: Get GitHub organization or user
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY})
- name: Set up Docker Buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Copy Dockerfile
run: cp Dockerfile.base Dockerfile.base.ubuntu-bionic; sed -i.bak 's/FROM.*/FROM ubuntu:bionic/' Dockerfile.base.ubuntu-bionic
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Build
run: docker buildx build -f Dockerfile.base.ubuntu-bionic -t ${ORG}/github-runner-base:ubuntu-bionic --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
ubuntu_base_xenial_deploy:
- name: Copy Repo Files
uses: actions/checkout@master
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Copy Dockerfile
run: cp Dockerfile.base Dockerfile.base.ubuntu-${{ matrix.release }}; sed -i.bak 's/FROM.*/FROM ubuntu:${{ matrix.release }}/' Dockerfile.base.ubuntu-${{ matrix.release }}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.base.ubuntu-${{ matrix.release }}
pull: true
push: true
tags: ${{ env.ORG }}/github-runner-base:ubuntu-${{ matrix.release }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
debian_base_deploy:
runs-on: ubuntu-latest
strategy:
matrix:
release: [bullseye, sid]
fail-fast: false
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- name: Get GitHub organization or user
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY})
- name: Set up Docker Buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Copy Dockerfile
run: cp Dockerfile.base Dockerfile.base.ubuntu-xenial; sed -i.bak 's/FROM.*/FROM ubuntu:xenial/' Dockerfile.base.ubuntu-xenial
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Build
run: docker buildx build -f Dockerfile.base.ubuntu-xenial -t ${ORG}/github-runner-base:ubuntu-xenial --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
- name: Copy Repo Files
uses: actions/checkout@master
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Copy Dockerfile
run: cp Dockerfile.base Dockerfile.base.debian-${{ matrix.release }}; sed -i.bak 's/FROM.*/FROM debian:${{ matrix.release }}/' Dockerfile.base.debian-${{ matrix.release }}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.base.debian-${{ matrix.release }}
pull: true
push: true
tags: ${{ env.ORG }}/github-runner-base:debian-${{ matrix.release }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
+114 -51
View File
@@ -7,63 +7,126 @@ on:
branches:
- master
- develop
schedule:
- cron: '59 23 * * *'
permissions:
contents: read
packages: write
jobs:
ubuntu_latest_deploy:
runs-on: ubuntu-latest
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- name: Get GitHub organization or user
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY})
- name: Set up Docker Buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Build
run: docker buildx build -f Dockerfile -t ${ORG}/github-runner:latest --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
ubuntu_bionic_deploy:
- name: Copy Repo Files
uses: actions/checkout@master
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Update Dockerfile FROM org
run: sed -i.bak "s/FROM.*/FROM ${ORG}\/github-runner-base:latest/" Dockerfile
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
pull: true
push: true
tags: ${{ env.ORG }}/github-runner:latest,ghcr.io/${{ github.repository }}:latest
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
ubuntu_deploy:
runs-on: ubuntu-latest
strategy:
matrix:
release: [jammy, focal, bionic]
fail-fast: false
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- name: Get GitHub organization or user
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY})
- name: Set up Docker Buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Copy Dockerfile
run: cp Dockerfile Dockerfile.ubuntu-bionic; sed -i.bak "s/FROM.*/FROM ${ORG}\/github-runner-base:ubuntu-bionic/" Dockerfile.ubuntu-bionic
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Build
run: docker buildx build -f Dockerfile.ubuntu-bionic -t ${ORG}/github-runner:ubuntu-bionic --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
ubuntu_xenial_deploy:
- name: Copy Repo Files
uses: actions/checkout@master
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Copy Dockerfile
run: cp Dockerfile Dockerfile.ubuntu-${{ matrix.release }}; sed -i.bak "s/FROM.*/FROM ${ORG}\/github-runner-base:ubuntu-${{ matrix.release }}/" Dockerfile.ubuntu-${{ matrix.release }}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu-${{ matrix.release }}
pull: true
push: true
tags: ${{env.ORG}}/github-runner:ubuntu-${{ matrix.release }},ghcr.io/${{ github.repository }}:ubuntu-${{ matrix.release }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
debian_deploy:
runs-on: ubuntu-latest
strategy:
matrix:
release: [bullseye, sid]
fail-fast: false
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- name: Get GitHub organization or user
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY})
- name: Set up Docker Buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Copy Dockerfile
run: cp Dockerfile Dockerfile.ubuntu-xenial; sed -i.bak "s/FROM.*/FROM ${ORG}\/github-runner-base:ubuntu-xenial/" Dockerfile.ubuntu-xenial
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Build
run: docker buildx build -f Dockerfile.ubuntu-xenial -t ${ORG}/github-runner:ubuntu-xenial --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
- name: Copy Repo Files
uses: actions/checkout@master
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Copy Dockerfile
run: cp Dockerfile Dockerfile.debian-${{ matrix.release }}; sed -i.bak "s/FROM.*/FROM ${ORG}\/github-runner-base:debian-${{ matrix.release }}/" Dockerfile.debian-${{ matrix.release }}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.debian-${{ matrix.release }}
pull: true
push: true
tags: ${{ env.ORG }}/github-runner:debian-${{ matrix.release }},ghcr.io/${{ github.repository }}:debian-${{ matrix.release }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
+120 -58
View File
@@ -4,13 +4,17 @@ on:
tags:
- '*'
permissions:
contents: write
packages: write
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
- name: Create Release
id: create_release
uses: actions/create-release@v1
@@ -21,70 +25,128 @@ jobs:
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
ubuntu_latest_tag:
runs-on: ubuntu-latest
needs: create-release
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- name: get version
run: echo ::set-env name=TAG::${GITHUB_REF#refs/tags/}
- name: Get GitHub organization or user
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY})
- name: Set up Docker Buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Build
run: docker buildx build -f Dockerfile -t ${ORG}/github-runner:${TAG} --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
ubuntu_bionic_tag:
- name: Copy Repo Files
uses: actions/checkout@master
- name: get version
run: echo 'TAG='${GITHUB_REF#refs/tags/} >> $GITHUB_ENV
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Update Dockerfile FROM org
run: sed -i.bak "s/FROM.*/FROM ${ORG}\/github-runner-base:latest/" Dockerfile
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
pull: true
push: true
tags: ${{ env.ORG }}/github-runner:${{ env.TAG }},ghcr.io/${{ github.repository }}:${{ env.TAG }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
ubuntu_tag:
runs-on: ubuntu-latest
needs: create-release
strategy:
matrix:
release: [jammy, focal, bionic]
fail-fast: false
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- name: get version
run: echo ::set-env name=TAG::${GITHUB_REF#refs/tags/}
- name: Get GitHub organization or user
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY})
- name: Set up Docker Buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Copy Dockerfile
run: cp Dockerfile Dockerfile.ubuntu-bionic; sed -i.bak "s/FROM.*/FROM ${ORG}\/github-runner-base:ubuntu-bionic/" Dockerfile.ubuntu-bionic
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Build
run: docker buildx build -f Dockerfile.ubuntu-bionic -t ${ORG}/github-runner:${TAG}-ubuntu-bionic --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
ubuntu_xenial_tag:
- name: Copy Repo Files
uses: actions/checkout@master
- name: get version
run: echo 'TAG='${GITHUB_REF#refs/tags/} >> $GITHUB_ENV
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Copy Dockerfile
run: cp Dockerfile Dockerfile.ubuntu-${{ matrix.release }}; sed -i.bak "s/FROM.*/FROM ${ORG}\/github-runner-base:ubuntu-${{ matrix.release }}/" Dockerfile.ubuntu-${{ matrix.release }}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu-${{ matrix.release }}
pull: true
push: true
tags: ${{ env.ORG }}/github-runner:${{ env.TAG }}-ubuntu-${{ matrix.release }},ghcr.io/${{ github.repository }}:${{ env.TAG }}-ubuntu-${{ matrix.release }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
debian_tag:
runs-on: ubuntu-latest
strategy:
matrix:
release: [bullseye, sid]
fail-fast: false
needs: create-release
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- name: get version
run: echo ::set-env name=TAG::${GITHUB_REF#refs/tags/}
- name: Get GitHub organization or user
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY})
- name: Set up Docker Buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Copy Dockerfile
run: cp Dockerfile Dockerfile.ubuntu-xenial; sed -i.bak "s/FROM.*/FROM ${ORG}\/github-runner-base:ubuntu-xenial/" Dockerfile.ubuntu-xenial
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Build
run: docker buildx build -f Dockerfile.ubuntu-xenial -t ${ORG}/github-runner:${TAG}-ubuntu-xenial --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
- name: Copy Repo Files
uses: actions/checkout@master
- name: get version
run: echo 'TAG='${GITHUB_REF#refs/tags/} >> $GITHUB_ENV
- name: Get GitHub organization or user
run: echo 'ORG='$(echo $(dirname ${GITHUB_REPOSITORY}) | awk '{print tolower($0)}') >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Copy Dockerfile
run: cp Dockerfile Dockerfile.debian-${{ matrix.release }}; sed -i.bak "s/FROM.*/FROM ${ORG}\/github-runner-base:debian-${{ matrix.release }}/" Dockerfile.debian-${{ matrix.release }}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.debian-${{ matrix.release }}
pull: true
push: true
tags: ${{ env.ORG }}/github-runner:${{ env.TAG }}-debian-${{ matrix.release }},ghcr.io/${{ github.repository }}:${{ env.TAG }}-debian-${{ matrix.release }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
+15
View File
@@ -0,0 +1,15 @@
on:
pull_request:
name: "Trigger: Push action"
jobs:
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
- uses: actions/setup-python@v4
- uses: pre-commit/action@v3.0.0
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
+8 -3
View File
@@ -1,8 +1,13 @@
repos:
- repo: git://github.com/detailyang/pre-commit-shell
rev: 1.0.2
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: shell-lint
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-case-conflict
- id: check-merge-conflict
- id: detect-private-key
- repo: https://github.com/stratasan/hadolint-pre-commit
rev: cdefcb096e520a6daa9552b1d4636f5f1e1729cd
hooks:
+1
View File
@@ -0,0 +1 @@
shellcheck 0.9.0
+17
View File
@@ -0,0 +1,17 @@
# Welcome to docker-github-actions-runner contributing guide <!-- omit in toc -->
Welcome!
## Code of conduct
Be kind, research before asking/contributing.
Please remember that my time is limited and my resources are as well. Solving "nuances" will likely require external contributions but I'm happy to help and guide.
### Issues
#### Create a new issue
If you spot an issue, [search if an issue already exists](https://docs.github.com/en/github/searching-for-information-on-github/searching-on-github/searching-issues-and-pull-requests#search-by-the-title-body-or-comments). If a related issue doesn't exist, you can open a new issue using a relevant issue.
Also use [the wiki](https://github.com/myoung34/docker-github-actions-runner/wiki) and contribute to it
+11 -4
View File
@@ -2,7 +2,11 @@
FROM myoung34/github-runner-base:latest
LABEL maintainer="myoung34@my.apsu.edu"
ARG GH_RUNNER_VERSION="2.263.0"
ENV AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache
RUN mkdir -p /opt/hostedtoolcache
ARG GH_RUNNER_VERSION="2.310.0"
ARG TARGETPLATFORM
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
@@ -12,8 +16,11 @@ COPY install_actions.sh /actions-runner
RUN chmod +x /actions-runner/install_actions.sh \
&& /actions-runner/install_actions.sh ${GH_RUNNER_VERSION} ${TARGETPLATFORM} \
&& rm /actions-runner/install_actions.sh
&& rm /actions-runner/install_actions.sh \
&& chown runner /_work /actions-runner /opt/hostedtoolcache
COPY token.sh entrypoint.sh app_token.sh /
RUN chmod +x /token.sh /entrypoint.sh /app_token.sh
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["./bin/Runner.Listener", "run", "--startuptype", "service"]
+63 -26
View File
@@ -1,44 +1,81 @@
FROM ubuntu:eoan
FROM ubuntu:focal
LABEL maintainer="myoung34@my.apsu.edu"
ARG GIT_VERSION="2.26.2"
ARG DUMB_INIT_VERSION="1.2.2"
ARG GIT_CORE_PPA_KEY="A1715D88E1DF1F24"
ENV GIT_LFS_VERSION="3.2.0"
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
# hadolint ignore=DL3003
RUN apt-get update && \
apt-get install -y --no-install-recommends \
# hadolint ignore=SC2086,DL3015,DL3008,DL3013,SC2015
RUN echo en_US.UTF-8 UTF-8 >> /etc/locale.gen \
&& apt-get update \
&& apt-get install -y --no-install-recommends gnupg \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ${GIT_CORE_PPA_KEY} \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
gnupg \
lsb-release \
curl \
tar \
unzip \
zip \
apt-transport-https \
ca-certificates \
sudo \
gnupg-agent \
gpg-agent \
software-properties-common \
build-essential \
zlib1g-dev \
zstd \
gettext \
liblttng-ust0 \
libcurl4-openssl-dev \
inetutils-ping \
jq \
&& rm -rf /var/lib/apt/lists/* \
&& c_rehash \
&& cd /tmp \
&& curl -sL https://www.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz -o git.tgz \
&& tar zxf git.tgz \
&& cd git-${GIT_VERSION} \
&& ./configure --prefix=/usr \
&& make \
&& make install \
&& cd / \
&& rm -rf /tmp/git.tgz /tmp/git-${GIT_VERSION}
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
&& [[ $(lsb_release -cs) == "eoan" ]] && ( add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu disco stable" ) || ( add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" )\
wget \
dirmngr \
openssh-client \
locales \
python3-pip \
python3-setuptools \
python3 \
dumb-init \
nodejs \
rsync \
libpq-dev \
gosu \
&& DPKG_ARCH="$(dpkg --print-architecture)" \
&& LSB_RELEASE_CODENAME="$(lsb_release --codename | cut -f2)" \
&& sed -e 's/Defaults.*env_reset/Defaults env_keep = "HTTP_PROXY HTTPS_PROXY NO_PROXY FTP_PROXY http_proxy https_proxy no_proxy ftp_proxy"/' -i /etc/sudoers \
&& echo deb http://ppa.launchpad.net/git-core/ppa/ubuntu $([[ $(grep -E '^ID=' /etc/os-release | sed 's/.*=//g') == "ubuntu" ]] && (grep VERSION_CODENAME /etc/os-release | sed 's/.*=//g') || echo bionic) main>/etc/apt/sources.list.d/git-core.list \
&& apt-get update \
&& apt-get install -y docker-ce docker-ce-cli containerd.io --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
RUN curl -sL "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \
&& chmod +x /usr/local/bin/docker-compose
&& ( apt-get install -y --no-install-recommends git || apt-get install -t stable -y --no-install-recommends git || apt-get install -y --no-install-recommends git=1:2.33.1-0ppa1~ubuntu18.04.1 git-man=1:2.33.1-0ppa1~ubuntu18.04.1 ) \
&& ( [[ $(apt-cache search -n liblttng-ust0 | awk '{print $1}') == "liblttng-ust0" ]] && apt-get install -y --no-install-recommends liblttng-ust0 || : ) \
&& ( [[ $(apt-cache search -n liblttng-ust1 | awk '{print $1}') == "liblttng-ust1" ]] && apt-get install -y --no-install-recommends liblttng-ust1 || : ) \
&& ( ( curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip" && unzip awscliv2.zip -d /tmp/ && /tmp/aws/install && rm awscliv2.zip) || pip3 install --no-cache-dir awscli ) \
&& ( curl -s "https://github.com/git-lfs/git-lfs/releases/download/v${GIT_LFS_VERSION}/git-lfs-linux-${DPKG_ARCH}-v${GIT_LFS_VERSION}.tar.gz" -L -o /tmp/lfs.tar.gz && tar -xzf /tmp/lfs.tar.gz -C /tmp && /tmp/git-lfs-${GIT_LFS_VERSION}/install.sh && rm -rf /tmp/lfs.tar.gz /tmp/git-lfs-${GIT_LFS_VERSION}) \
&& distro=$(lsb_release -is | awk '{print tolower($0)}') \
&& mkdir -p /etc/apt/keyrings \
&& ( curl -fsSL https://download.docker.com/linux/${distro}/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg ) \
&& version=$(lsb_release -cs | sed 's/trixie\|n\/a/bookworm/g') \
&& ( echo "deb [arch=${DPKG_ARCH} signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/${distro} ${version} stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null ) \
&& apt-get update \
&& apt-get install -y docker-ce docker-ce-cli docker-buildx-plugin containerd.io docker-compose-plugin --no-install-recommends --allow-unauthenticated \
&& echo -e '#!/bin/sh\ndocker compose --compatibility "$@"' > /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose \
&& ( [[ "${LSB_RELEASE_CODENAME}" == "focal" ]] && ( echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /" | tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list && curl -L "https://build.opensuse.org/projects/devel:kubic/public_key" | apt-key add -; echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /" | tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list && curl -L "https://build.opensuse.org/projects/devel:kubic/public_key" | apt-key add - && apt-get update) || : ) \
&& ( [[ "${LSB_RELEASE_CODENAME}" == "focal" || "${LSB_RELEASE_CODENAME}" == "jammy" || "${LSB_RELEASE_CODENAME}" == "sid" || "${LSB_RELEASE_CODENAME}" == "bullseye" ]] && apt-get install -y --no-install-recommends podman buildah skopeo || : ) \
&& ( [[ "${LSB_RELEASE_CODENAME}" == "jammy" ]] && echo "Ubuntu Jammy is marked as beta. Please see https://github.com/actions/virtual-environments/issues/5490" || : ) \
&& GH_CLI_VERSION=$(curl -sL -H "Accept: application/vnd.github+json" https://api.github.com/repos/cli/cli/releases/latest | jq -r '.tag_name' | sed 's/^v//g') \
&& GH_CLI_DOWNLOAD_URL=$(curl -sL -H "Accept: application/vnd.github+json" https://api.github.com/repos/cli/cli/releases/latest | jq ".assets[] | select(.name == \"gh_${GH_CLI_VERSION}_linux_${DPKG_ARCH}.deb\")" | jq -r '.browser_download_url') \
&& curl -sSLo /tmp/ghcli.deb ${GH_CLI_DOWNLOAD_URL} && apt-get -y install /tmp/ghcli.deb && rm /tmp/ghcli.deb \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/* \
&& groupadd -g 121 runner \
&& useradd -mr -d /home/runner -u 1001 -g 121 runner \
&& usermod -aG sudo runner \
&& usermod -aG docker runner \
&& echo '%sudo ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers \
&& ( [[ -f /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list ]] && rm /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list || : )
+51 -198
View File
@@ -1,219 +1,72 @@
Docker Github Actions Runner
============================
[![Docker Pulls](https://img.shields.io/docker/pulls/myoung34/github-runner.svg)](https://hub.docker.com/r/myoung34/github-runner)
[![Docker Pulls](https://img.shields.io/docker/pulls/myoung34/github-runner.svg)](https://hub.docker.com/r/myoung34/github-runner) [![awesome-runners](https://img.shields.io/badge/listed%20on-awesome--runners-blue.svg)](https://github.com/jonico/awesome-runners)
This will run the [new self-hosted github actions runners](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/hosting-your-own-runners).
This has been tested and verified on:
## Quick-Start (Examples and Usage) ##
* x86_64
* armhf
* armv7
* arm64
**NOTE: Only one runner can use the same RUNNER_WORKDIR if it is shared storage.**
Please see [the wiki](https://github.com/myoung34/docker-github-actions-runner/wiki/Usage)
Please read [the contributing guidelines](https://github.com/myoung34/docker-github-actions-runner/blob/master/CONTRIBUTING.md)
## Examples ##
## Notes ##
### Note ###
### Security ###
If you're using a RHEL based OS with SELinux, add `--security-opt=label=disable` to prevent [permission denied](https://github.com/myoung34/docker-github-actions-runner/issues/9)
It is known that environment variables are not safe from exfiltration.
If you are using this runner make sure that any workflow changes are gated by a verification process (in the actions settings) so that malicious PR's cannot exfiltrate these.
### Manual ###
### Docker Support ###
```
# org runner
docker run -d --restart always --name github-runner \
-e REPO_URL="https://github.com/myoung34/repo" \
-e RUNNER_NAME="foo-runner" \
-e RUNNER_TOKEN="footoken" \
-e RUNNER_WORKDIR="/tmp/github-runner-your-repo" \
-e ORG_RUNNER="true" \
-e ORG_NAME="octokode" \
-e LABELS="my-label,other-label" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp/github-runner-your-repo:/tmp/github-runner-your-repo \
myoung34/github-runner:latest
# per repo
docker run -d --restart always --name github-runner \
-e REPO_URL="https://github.com/myoung34/repo" \
-e RUNNER_NAME="foo-runner" \
-e RUNNER_TOKEN="footoken" \
-e RUNNER_WORKDIR="/tmp/github-runner-your-repo" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp/github-runner-your-repo:/tmp/github-runner-your-repo \
myoung34/github-runner:latest
```
Please note that while this runner installs and allows docker, github actions itself does not support using docker from a self hosted runner yet.
For more information:
Or shell wrapper:
* https://github.com/actions/runner/issues/406
* https://github.com/actions/runner/issues/367
```
function github-runner {
name=github-runner-${1//\//-}
org=$(dirname $1)
repo=$(basename $1)
tag=${3:-latest}
docker rm -f $name
docker run -d --restart=always \
-e REPO_URL="https://github.com/${org}/${repo}" \
-e RUNNER_TOKEN="$2" \
-e RUNNER_NAME="linux-${repo}" \
-e RUNNER_WORKDIR="/tmp/github-runner-${repo}" \
-e ORG_RUNNER="true" \
-e ORG_NAME="octokode" \
-e LABELS="my-label,other-label" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp/github-runner-${repo}:/tmp/github-runner-${repo} \
--name $name ${org}/github-runner:${tag}
}
Also, some GitHub Actions Workflow features, like [Job Services](https://docs.github.com/en/actions/guides/about-service-containers), won't be usable and [will result in an error](https://github.com/myoung34/docker-github-actions-runner/issues/61).
github-runner your-account/your-repo AARGHTHISISYOURGHACTIONSTOKEN
github-runner your-account/some-other-repo ARGHANOTHERGITHUBACTIONSTOKEN ubuntu-xenial
```
### Containerd Support ###
Or `docker-compose.yml`:
```yml
version: '2.3'
Currently runners [do not support containerd](https://github.com/actions/runner/issues/1265)
services:
worker:
build: .
image: myoung34/github-runner:latest
environment:
REPO_URL: https://github.com/example/repo
RUNNER_NAME: example-name
RUNNER_TOKEN: someGithubTokenHere
RUNNER_WORKDIR: /tmp/runner/work
ORG_RUNNER: true
ORG_NAME: example-github-org
LABELS: linux,x64,gpu
security_opt:
# needed on SELinux systems to allow docker container to manage other docker containers
- label:disable
volumes:
- '/var/run/docker.sock:/var/run/docker.sock'
- '/tmp/runner:/tmp/runner'
# note: a quirk of docker-in-docker is that this path
# needs to be the same path on host and inside the container,
# docker mgmt cmds run outside of docker but expect the paths from within
```
## Docker Artifacts ##
### Nomad ###
| Container Base | Supported Architectures | Tag Regex | Docker Tags | Description | Notes |
| --- | --- | --- | --- | --- | --- |
| ubuntu focal | `x86_64`,`arm64` | `/\d\.\d{3}\.\d+/` `/\d\.\d{3}\.\d+-ubuntu-focal/`| [latest](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=latest) [ubuntu-focal](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=ubuntu-focal) | This is the latest build (Rebuilt nightly and on master merges). Tags without an OS name are included. Tags with `-ubuntu-focal` are included and created on [upstream tags](https://github.com/actions/runner/tags).|
| ubuntu jammy | `x86_64`,`arm64` | `/\d\.\d{3}\.\d+-ubuntu-jammy/` | [ubuntu-jammy](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=ubuntu-jammy) | This is the latest build from jammy (Rebuilt nightly and on master merges). Tags with `-ubuntu-jammy` are included and created on [upstream tags](https://github.com/actions/runner/tags). | There is [currently an issue with jammy from inside a 20.04LTS host](https://github.com/myoung34/docker-github-actions-runner/issues/219) which is why this is not `latest` |
| ubuntu bionic | `x86_64`,`arm64` | `/\d\.\d{3}\.\d+-ubuntu-bionic/` | [ubuntu-bionic](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=ubuntu-bionic) | This is the latest build from bionic (Rebuilt nightly and on master merges). Tags with `-ubuntu-bionic` are included and created on [upstream tags](https://github.com/actions/runner/tags). | |
| debian buster (now deprecated) | `x86_64`,`arm64` | `/\d\.\d{3}\.\d+-debian-buster/` | [debian-buster](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=debian-buster) | Debian buster is now deprecated. The packages for arm v7 are in flux and are wildly causing build failures (git as well as apt-key and liblttng-ust#. Tags with `-debian-buster` are included and created on [upstream tags](https://github.com/actions/runner/tags). | |
| debian bullseye | `x86_64`,`arm64` | `/\d\.\d{3}\.\d+-debian-bullseye/` | [debian-bullseye](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=debian-bullseye) | This is the latest build from bullseye (Rebuilt nightly and on master merges). Tags with `-debian-bullseye` are included and created on [upstream tags](https://github.com/actions/runner/tags). | |
| debian sid | `x86_64`,`arm64` | `/\d\.\d{3}\.\d+-debian-sid/` | [debian-sid](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=debian-sid) | This is the latest build from sid (Rebuilt nightly and on master merges). Tags with `-debian-sid` are included and created on [upstream tags](https://github.com/actions/runner/tags). | |
```
job "github_runner" {
datacenters = ["home"]
type = "system"
These containers are built via Github actions that [copy the dockerfile](https://github.com/myoung34/docker-github-actions-runner/blob/master/.github/workflows/deploy.yml#L47), changing the `FROM` and building to provide simplicity.
task "runner" {
driver = "docker"
## Environment Variables ##
env {
REPO_URL = "https://github.com/your-account/your-repo"
RUNNER_TOKEN = "footoken"
RUNNER_WORKDIR = "/tmp/github-runner-your-repo"
ORG_RUNNER = "true"
ORG_NAME = "octokode"
LABELS = "my-label,other-label"
}
config {
privileged = true
image = "myoung34/github-runner:latest"
volumes = [
"/var/run/docker.sock:/var/run/docker.sock",
"/tmp/github-runner-your-repo:/tmp/github-runner-your-repo",
]
}
}
}
```
### Kubernetes ###
```
apiVersion: apps/v1
kind: Deployment
metadata:
name: actions-runner
namespace: runners
spec:
replicas: 1
selector:
matchLabels:
app: actions-runner
template:
metadata:
labels:
app: actions-runner
spec:
volumes:
- name: dockersock
hostPath:
path: /var/run/docker.sock
- name: workdir
hostPath:
path: /tmp/github-runner-your-repo
containers:
- name: runner
image: myoung34/github-runner:latest
env:
- name: ORG_RUNNER
value: true
- name: ORG_NAME
value: octokode
- name: LABELS
value: my-label,other-label
- name: RUNNER_TOKEN
value: footoken
- name: REPO_URL
value: https://github.com/your-account/your-repo
- name: RUNNER_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: RUNNER_WORKDIR
value: /tmp/github-runner-your-repo
volumeMounts:
- name: dockersock
mountPath: /var/run/docker.sock
- name: workdir
mountPath: /tmp/github-runner-your-repo
```
## Usage From GH Actions Workflow ##
```
name: Package
on:
release:
types: [created]
jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v1
- name: build packages
run: make all
```
## Automatically Acquiring a Runner Token ##
A runner token can be automatically acquired at runtime if `ACCESS_TOKEN` (a GitHub personal access token) is a supplied. This uses the [GitHub Actions API](https://developer.github.com/v3/actions/self_hosted_runners/#create-a-registration-token). e.g.:
```
docker run -d --restart always --name github-runner \
-e ACCESS_TOKEN="footoken" \
-e REPO_URL="https://github.com/myoung34/repo" \
-e RUNNER_NAME="foo-runner" \
-e RUNNER_WORKDIR="/tmp/github-runner-your-repo" \
-e ORG_RUNNER="true" \
-e ORG_NAME="octokode" \
-e LABELS="my-label,other-label" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp/github-runner-your-repo:/tmp/github-runner-your-repo \
myoung34/github-runner:latest
```
| Environment Variable | Description |
| --- | --- |
| `RUN_AS_ROOT` | Boolean to run as root. If `true`: will run as root. If `True` and the user is overridden it will error. If any other value it will run as the `runner` user and allow an optional override. Default is `true` |
| `RUNNER_NAME` | The name of the runner to use. Supercedes (overrides) `RUNNER_NAME_PREFIX` |
| `RUNNER_NAME_PREFIX` | A prefix for runner name (See `RANDOM_RUNNER_SUFFIX` for how the full name is generated). Note: will be overridden by `RUNNER_NAME` if provided. Defaults to `github-runner` |
| `RANDOM_RUNNER_SUFFIX` | Boolean to use a randomized runner name suffix (preceeded by `RUNNER_NAME_PREFIX`). Will use a 13 character random string by default. If set to a value other than true it will attempt to use the contents of `/etc/hostname` or fall back to a random string if the file does not exist or is empty. Note: will be overridden by `RUNNER_NAME` if provided. Defaults to `true`. |
| `ACCESS_TOKEN` | A [github PAT](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) to use to generate `RUNNER_TOKEN` dynamically at container start. Not using this requires a valid `RUNNER_TOKEN` |
| `APP_ID` | The github application ID. Must be paired with `APP_PRIVATE_KEY` and should not be used with `ACCESS_TOKEN` or `RUNNER_TOKEN` |
| `APP_PRIVATE_KEY` | The github application private key. Must be paired with `APP_ID` and should not be used with `ACCESS_TOKEN` or `RUNNER_TOKEN` |
| `APP_LOGIN` | The github application login id. Can be paired with `APP_ID` and `APP_PRIVATE_KEY` if default value extracted from `REPO_URL` or `ORG_NAME` is not correct. Note that no default is present when `RUNNER_SCOPE` is 'enterprise'. |
| `RUNNER_SCOPE` | The scope the runner will be registered on. Valid values are `repo`, `org` and `ent`. For 'org' and 'enterprise', `ACCESS_TOKEN` is required and `REPO_URL` is unnecessary. If 'org', requires `ORG_NAME`; if 'enterprise', requires `ENTERPRISE_NAME`. Default is 'repo'. |
| `ORG_NAME` | The organization name for the runner to register under. Requires `RUNNER_SCOPE` to be 'org'. No default value. |
| `ENTERPRISE_NAME` | The enterprise name for the runner to register under. Requires `RUNNER_SCOPE` to be 'enterprise'. No default value. |
| `LABELS` | A comma separated string to indicate the labels. Default is 'default' |
| `REPO_URL` | If using a non-organization runner this is the full repository url to register under such as 'https://github.com/myoung34/repo' |
| `RUNNER_TOKEN` | If not using a PAT for `ACCESS_TOKEN` this will be the runner token provided by the Add Runner UI (a manual process). Note: This token is short lived and will change frequently. `ACCESS_TOKEN` is likely preferred. |
| `RUNNER_WORKDIR` | The working directory for the runner. Runners on the same host should not share this directory. Default is '/_work'. This must match the source path for the bind-mounted volume at RUNNER_WORKDIR, in order for container actions to access files. |
| `RUNNER_GROUP` | Name of the runner group to add this runner to (defaults to the default runner group) |
| `GITHUB_HOST` | Optional URL of the Github Enterprise server e.g github.mycompany.com. Defaults to `github.com`. |
| `DISABLE_AUTOMATIC_DEREGISTRATION` | Optional flag to disable signal catching for deregistration. Default is `false`. Any value other than exactly `false` is considered `true`. See [here](https://github.com/myoung34/docker-github-actions-runner/issues/94) |
| `CONFIGURED_ACTIONS_RUNNER_FILES_DIR` | Path to use for runner data. It allows avoiding reregistration each the start of the runner. No default value. |
| `EPHEMERAL` | Optional flag to configure runner with [`--ephemeral` option](https://docs.github.com/en/actions/hosting-your-own-runners/autoscaling-with-self-hosted-runners#using-ephemeral-runners-for-autoscaling). Ephemeral runners are suitable for autoscaling. |
| `DISABLE_AUTO_UPDATE` | Optional environment variable to [disable auto updates](https://github.blog/changelog/2022-02-01-github-actions-self-hosted-runners-can-now-disable-automatic-updates/). Auto updates are enabled by default to preserve past behavior. Any value is considered truthy and will disable them. |
| `START_DOCKER_SERVICE` | Optional flag which automatically starts the docker service if set to `true`. Useful when using [sysbox](https://github.com/nestybox/sysbox). Defaults to `false`.
+23
View File
@@ -0,0 +1,23 @@
## Security
If you believe you have found a security vulnerability, please report it to me as described below.
## Reporting Security Issues
**Please do not report security vulnerabilities through public GitHub issues.** Instead, please report them to me directly at [myoung34@my.apsu.edu](mailto:myoung34@my.apsu.edu).
If you'd like to communicate securely, my keybase is [here](https://keybase.io/3vilpenguin)
Please include the requested information listed below (as much as you can provide) to help better understand the nature and scope of the possible issue:
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue
## Preferred Languages
I prefer all communications to be in English.
+89
View File
@@ -0,0 +1,89 @@
#!/bin/bash
#
# Request an ACCESS_TOKEN to be used by a GitHub APP
# Environment variable that need to be set up:
# * APP_ID, the GitHub's app ID
# * APP_PRIVATE_KEY, the content of GitHub app's private key in PEM format.
# * APP_LOGIN, the login name used to install GitHub's app
#
# https://github.com/orgs/community/discussions/24743#discussioncomment-3245300
#
set -o pipefail
_GITHUB_HOST=${GITHUB_HOST:="github.com"}
# If URL is not github.com then use the enterprise api endpoint
if [[ ${GITHUB_HOST} = "github.com" ]]; then
URI="https://api.${_GITHUB_HOST}"
else
URI="https://${_GITHUB_HOST}/api/v3"
fi
API_VERSION=v3
API_HEADER="Accept: application/vnd.github.${API_VERSION}+json"
CONTENT_LENGTH_HEADER="Content-Length: 0"
APP_INSTALLATIONS_URI="${URI}/app/installations"
# JWT parameters based off
# https://docs.github.com/en/developers/apps/building-github-apps/authenticating-with-github-apps#authenticating-as-a-github-app
#
# JWT token issuance and expiration parameters
JWT_IAT_DRIFT=60
JWT_EXP_DELTA=600
JWT_JOSE_HEADER='{
"alg": "RS256",
"typ": "JWT"
}'
build_jwt_payload() {
now=$(date +%s)
iat=$((now - JWT_IAT_DRIFT))
jq -c \
--arg iat_str "${iat}" \
--arg exp_delta_str "${JWT_EXP_DELTA}" \
--arg app_id_str "${APP_ID}" \
'
($iat_str | tonumber) as $iat
| ($exp_delta_str | tonumber) as $exp_delta
| ($app_id_str | tonumber) as $app_id
| .iat = $iat
| .exp = ($iat + $exp_delta)
| .iss = $app_id
' <<< "{}" | tr -d '\n'
}
base64url() {
base64 | tr '+/' '-_' | tr -d '=\n'
}
rs256_sign() {
openssl dgst -binary -sha256 -sign <(echo "$1")
}
request_access_token() {
jwt_payload=$(build_jwt_payload)
encoded_jwt_parts=$(base64url <<<"${JWT_JOSE_HEADER}").$(base64url <<<"${jwt_payload}")
encoded_mac=$(echo -n "${encoded_jwt_parts}" | rs256_sign "${APP_PRIVATE_KEY}" | base64url)
generated_jwt="${encoded_jwt_parts}.${encoded_mac}"
auth_header="Authorization: Bearer ${generated_jwt}"
app_installations_response=$(curl -sX GET \
-H "${auth_header}" \
-H "${API_HEADER}" \
"${APP_INSTALLATIONS_URI}" \
)
access_token_url=$(echo "${app_installations_response}" | jq --raw-output '.[] | select (.account.login == "'"${APP_LOGIN}"'" and .app_id == '"${APP_ID}"') .access_tokens_url')
curl -sX POST \
-H "${CONTENT_LENGTH_HEADER}" \
-H "${auth_header}" \
-H "${API_HEADER}" \
"${access_token_url}" | \
jq --raw-output .token
}
request_access_token
+187 -38
View File
@@ -1,49 +1,198 @@
#!/bin/bash
#!/usr/bin/dumb-init /bin/bash
# shellcheck shell=bash
export RUNNER_ALLOW_RUNASROOT=1
export PATH=$PATH:/actions-runner
export PATH=${PATH}:/actions-runner
_RUNNER_NAME=${RUNNER_NAME:-default}
_RUNNER_WORKDIR=${RUNNER_WORKDIR:-/_work}
_ORG_RUNNER=${ORG_RUNNER:-false}
_LABELS=${LABELS:-default}
_SHORT_URL=${REPO_URL}
# Un-export these, so that they must be passed explicitly to the environment of
# any command that needs them. This may help prevent leaks.
export -n ACCESS_TOKEN
export -n RUNNER_TOKEN
export -n APP_ID
export -n APP_PRIVATE_KEY
if [[ -n "${ACCESS_TOKEN}" ]]; then
URI=https://api.github.com
API_VERSION=v3
API_HEADER="Accept: application/vnd.github.${API_VERSION}+json"
AUTH_HEADER="Authorization: token ${ACCESS_TOKEN}"
deregister_runner() {
echo "Caught SIGTERM. Deregistering runner"
if [[ -n "${ACCESS_TOKEN}" ]]; then
_TOKEN=$(ACCESS_TOKEN="${ACCESS_TOKEN}" bash /token.sh)
RUNNER_TOKEN=$(echo "${_TOKEN}" | jq -r .token)
fi
./config.sh remove --token "${RUNNER_TOKEN}"
exit
}
_PROTO="$(echo "${REPO_URL}" | grep :// | sed -e's,^\(.*://\).*,\1,g')"
# shellcheck disable=SC2116
_URL="$(echo "${REPO_URL/${_PROTO}/}")"
_PATH="$(echo "${_URL}" | grep / | cut -d/ -f2-)"
_ACCOUNT="$(echo "${_PATH}" | cut -d/ -f1)"
_REPO="$(echo "${_PATH}" | cut -d/ -f2)"
_DISABLE_AUTOMATIC_DEREGISTRATION=${DISABLE_AUTOMATIC_DEREGISTRATION:-false}
_FULL_URI="${URI}/repos/${_ACCOUNT}/${_REPO}/actions/runners/registration-token"
if [[ ${_ORG_RUNNER} == "true" ]]; then
[[ -z ${ORG_NAME} ]] && ( echo "ORG_NAME required for org runners"; exit 1 )
_FULL_URI="${URI}/orgs/${ORG_NAME}/actions/runners/registration-token"
_SHORT_URL="${_PROTO}github.com/${ORG_NAME}"
_RANDOM_RUNNER_SUFFIX=${RANDOM_RUNNER_SUFFIX:="true"}
_RUNNER_NAME=${RUNNER_NAME:-${RUNNER_NAME_PREFIX:-github-runner}-$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 ; echo '')}
if [[ ${RANDOM_RUNNER_SUFFIX} != "true" ]]; then
# In some cases this file does not exist
if [[ -f "/etc/hostname" ]]; then
# in some cases it can also be empty
if [[ $(stat --printf="%s" /etc/hostname) -ne 0 ]]; then
_RUNNER_NAME=${RUNNER_NAME:-${RUNNER_NAME_PREFIX:-github-runner}-$(cat /etc/hostname)}
echo "RANDOM_RUNNER_SUFFIX is ${RANDOM_RUNNER_SUFFIX}. /etc/hostname exists and has content. Setting runner name to ${_RUNNER_NAME}"
else
echo "RANDOM_RUNNER_SUFFIX is ${RANDOM_RUNNER_SUFFIX} ./etc/hostname exists but is empty. Not using /etc/hostname."
fi
RUNNER_TOKEN="$(curl -XPOST -fsSL \
-H "${AUTH_HEADER}" \
-H "${API_HEADER}" \
"${_FULL_URI}" \
| jq -r '.token')"
else
echo "RANDOM_RUNNER_SUFFIX is ${RANDOM_RUNNER_SUFFIX} but /etc/hostname does not exist. Not using /etc/hostname."
fi
fi
echo "Configuring"
_RUNNER_WORKDIR=${RUNNER_WORKDIR:-/_work/${_RUNNER_NAME}}
_LABELS=${LABELS:-default}
_RUNNER_GROUP=${RUNNER_GROUP:-Default}
_GITHUB_HOST=${GITHUB_HOST:="github.com"}
_RUN_AS_ROOT=${RUN_AS_ROOT:="true"}
_START_DOCKER_SERVICE=${START_DOCKER_SERVICE:="false"}
./config.sh \
--url "${_SHORT_URL}" \
--token "${RUNNER_TOKEN}" \
--name "${_RUNNER_NAME}" \
--work "${_RUNNER_WORKDIR}" \
--labels "${_LABELS}" \
--unattended \
--replace
# ensure backwards compatibility
if [[ -z ${RUNNER_SCOPE} ]]; then
if [[ ${ORG_RUNNER} == "true" ]]; then
echo 'ORG_RUNNER is now deprecated. Please use RUNNER_SCOPE="org" instead.'
export RUNNER_SCOPE="org"
else
export RUNNER_SCOPE="repo"
fi
fi
./bin/runsvc.sh
RUNNER_SCOPE="${RUNNER_SCOPE,,}" # to lowercase
case ${RUNNER_SCOPE} in
org*)
[[ -z ${ORG_NAME} ]] && ( echo "ORG_NAME required for org runners"; exit 1 )
_SHORT_URL="https://${_GITHUB_HOST}/${ORG_NAME}"
RUNNER_SCOPE="org"
if [[ -n "${APP_ID}" ]] && [[ -z "${APP_LOGIN}" ]]; then
APP_LOGIN=${ORG_NAME}
fi
;;
ent*)
[[ -z ${ENTERPRISE_NAME} ]] && ( echo "ENTERPRISE_NAME required for enterprise runners"; exit 1 )
_SHORT_URL="https://${_GITHUB_HOST}/enterprises/${ENTERPRISE_NAME}"
RUNNER_SCOPE="enterprise"
;;
*)
[[ -z ${REPO_URL} ]] && ( echo "REPO_URL required for repo runners"; exit 1 )
_SHORT_URL=${REPO_URL}
RUNNER_SCOPE="repo"
if [[ -n "${APP_ID}" ]] && [[ -z "${APP_LOGIN}" ]]; then
APP_LOGIN=${REPO_URL%/*}
APP_LOGIN=${APP_LOGIN##*/}
fi
;;
esac
configure_runner() {
ARGS=()
if [[ -n "${APP_ID}" ]] && [[ -n "${APP_PRIVATE_KEY}" ]] && [[ -n "${APP_LOGIN}" ]]; then
if [[ -n "${ACCESS_TOKEN}" ]] || [[ -n "${RUNNER_TOKEN}" ]]; then
echo "ERROR: ACCESS_TOKEN or RUNNER_TOKEN provided but are mutually exclusive with APP_ID, APP_PRIVATE_KEY and APP_LOGIN." >&2
exit 1
fi
echo "Obtaining access token for app_id ${APP_ID} and login ${APP_LOGIN}"
nl="
"
ACCESS_TOKEN=$(APP_ID="${APP_ID}" APP_PRIVATE_KEY="${APP_PRIVATE_KEY//\\n/${nl}}" APP_LOGIN="${APP_LOGIN}" bash /app_token.sh)
elif [[ -n "${APP_ID}" ]] || [[ -n "${APP_PRIVATE_KEY}" ]] || [[ -n "${APP_LOGIN}" ]]; then
echo "ERROR: All of APP_ID, APP_PRIVATE_KEY and APP_LOGIN must be specified." >&2
exit 1
fi
if [[ -n "${ACCESS_TOKEN}" ]]; then
echo "Obtaining the token of the runner"
_TOKEN=$(ACCESS_TOKEN="${ACCESS_TOKEN}" bash /token.sh)
RUNNER_TOKEN=$(echo "${_TOKEN}" | jq -r .token)
fi
# shellcheck disable=SC2153
if [ -n "${EPHEMERAL}" ]; then
echo "Ephemeral option is enabled"
ARGS+=("--ephemeral")
fi
if [ -n "${DISABLE_AUTO_UPDATE}" ]; then
echo "Disable auto update option is enabled"
ARGS+=("--disableupdate")
fi
echo "Configuring"
./config.sh \
--url "${_SHORT_URL}" \
--token "${RUNNER_TOKEN}" \
--name "${_RUNNER_NAME}" \
--work "${_RUNNER_WORKDIR}" \
--labels "${_LABELS}" \
--runnergroup "${_RUNNER_GROUP}" \
--unattended \
--replace \
"${ARGS[@]}"
[[ ! -d "${_RUNNER_WORKDIR}" ]] && mkdir "${_RUNNER_WORKDIR}"
}
# Opt into runner reusage because a value was given
if [[ -n "${CONFIGURED_ACTIONS_RUNNER_FILES_DIR}" ]]; then
echo "Runner reusage is enabled"
# directory exists, copy the data
if [[ -d "${CONFIGURED_ACTIONS_RUNNER_FILES_DIR}" ]]; then
echo "Copying previous data"
cp -p -r "${CONFIGURED_ACTIONS_RUNNER_FILES_DIR}/." "/actions-runner"
fi
if [ -f "/actions-runner/.runner" ]; then
echo "The runner has already been configured"
else
configure_runner
fi
else
echo "Runner reusage is disabled"
configure_runner
fi
if [[ -n "${CONFIGURED_ACTIONS_RUNNER_FILES_DIR}" ]]; then
echo "Reusage is enabled. Storing data to ${CONFIGURED_ACTIONS_RUNNER_FILES_DIR}"
# Quoting (even with double-quotes) the regexp brokes the copying
cp -p -r "/actions-runner/_diag" "/actions-runner/svc.sh" /actions-runner/.[^.]* "${CONFIGURED_ACTIONS_RUNNER_FILES_DIR}"
fi
if [[ ${_DISABLE_AUTOMATIC_DEREGISTRATION} == "false" ]]; then
trap deregister_runner SIGINT SIGQUIT SIGTERM INT TERM QUIT
fi
# Start docker service if needed (e.g. for docker-in-docker)
if [[ ${_START_DOCKER_SERVICE} == "true" ]]; then
echo "Starting docker service"
_PREFIX=""
[[ ${_RUN_AS_ROOT} != "true" ]] && _PREFIX="sudo"
${_PREFIX} service docker start
fi
# Container's command (CMD) execution as runner user
if [[ ${_RUN_AS_ROOT} == "true" ]]; then
if [[ $(id -u) -eq 0 ]]; then
"$@"
else
echo "ERROR: RUN_AS_ROOT env var is set to true but the user has been overridden and is not running as root, but UID '$(id -u)'"
exit 1
fi
else
if [[ $(id -u) -eq 0 ]]; then
[[ -n "${CONFIGURED_ACTIONS_RUNNER_FILES_DIR}" ]] && chown -R runner "${CONFIGURED_ACTIONS_RUNNER_FILES_DIR}"
chown -R runner "${_RUNNER_WORKDIR}" /actions-runner
# The toolcache is not recursively chowned to avoid recursing over prepulated tooling in derived docker images
chown runner /opt/hostedtoolcache/
/usr/sbin/gosu runner "$@"
else
"$@"
fi
fi
+2 -4
View File
@@ -1,11 +1,9 @@
#!/bin/bash -x
#!/bin/bash -ex
GH_RUNNER_VERSION=$1
TARGETPLATFORM=$2
export TARGET_ARCH="x64"
if [[ $TARGETPLATFORM == "linux/arm/v7" ]]; then
export TARGET_ARCH="arm"
elif [[ $TARGETPLATFORM == "linux/arm64" ]]; then
if [[ $TARGETPLATFORM == "linux/arm64" ]]; then
export TARGET_ARCH="arm64"
fi
curl -L "https://github.com/actions/runner/releases/download/v${GH_RUNNER_VERSION}/actions-runner-linux-${TARGET_ARCH}-${GH_RUNNER_VERSION}.tar.gz" > actions.tar.gz
+17
View File
@@ -0,0 +1,17 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
],
"packageRules": [
{
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
"automerge": true
},
{
"matchDepTypes": ["devDependencies"],
"automerge": true
}
],
"platformAutomerge": true
}
+4
View File
@@ -0,0 +1,4 @@
linter:
actionlint:
ignore:
- ".*Quote this to prevent word splitting.*"
+44
View File
@@ -0,0 +1,44 @@
#!/bin/bash
_GITHUB_HOST=${GITHUB_HOST:="github.com"}
# If URL is not github.com then use the enterprise api endpoint
if [[ ${GITHUB_HOST} = "github.com" ]]; then
URI="https://api.${_GITHUB_HOST}"
else
URI="https://${_GITHUB_HOST}/api/v3"
fi
API_VERSION=v3
API_HEADER="Accept: application/vnd.github.${API_VERSION}+json"
AUTH_HEADER="Authorization: token ${ACCESS_TOKEN}"
CONTENT_LENGTH_HEADER="Content-Length: 0"
case ${RUNNER_SCOPE} in
org*)
_FULL_URL="${URI}/orgs/${ORG_NAME}/actions/runners/registration-token"
;;
ent*)
_FULL_URL="${URI}/enterprises/${ENTERPRISE_NAME}/actions/runners/registration-token"
;;
*)
_PROTO="https://"
# shellcheck disable=SC2116
_URL="$(echo "${REPO_URL/${_PROTO}/}")"
_PATH="$(echo "${_URL}" | grep / | cut -d/ -f2-)"
_ACCOUNT="$(echo "${_PATH}" | cut -d/ -f1)"
_REPO="$(echo "${_PATH}" | cut -d/ -f2)"
_FULL_URL="${URI}/repos/${_ACCOUNT}/${_REPO}/actions/runners/registration-token"
;;
esac
RUNNER_TOKEN="$(curl -XPOST -fsSL \
-H "${CONTENT_LENGTH_HEADER}" \
-H "${AUTH_HEADER}" \
-H "${API_HEADER}" \
"${_FULL_URL}" \
| jq -r '.token')"
echo "{\"token\": \"${RUNNER_TOKEN}\", \"full_url\": \"${_FULL_URL}\"}"