Files
runner/docs/automate.md
T

58 lines
1.8 KiB
Markdown
Raw Normal View History

2020-04-15 12:41:16 -04:00
# Automate Configuring Self-Hosted Runners
2020-04-14 20:41:49 -04:00
2020-04-15 12:35:17 -04:00
## Export PAT
2020-04-14 20:41:49 -04:00
2020-04-15 12:35:17 -04:00
Before running any of these sample scripts, create a GitHub PAT and export it before running the script
2020-04-14 20:41:49 -04:00
```bash
export RUNNER_CFG_PAT=yourPAT
```
2020-04-15 12:41:16 -04:00
## Create running as a service
2020-04-14 20:41:49 -04:00
2020-04-15 12:35:17 -04:00
**Scenario**: Run on a machine or VM (not container) which automates:
- Resolving latest released runner
- Download and extract latest
- Acquire a registration token
- Configure the runner
- Run as a systemd (linux) or Launchd (osx) service
2020-04-15 12:41:16 -04:00
:point_right: [Sample script here](../scripts/create-latest-svc.sh) :point_left:
2020-04-15 12:35:17 -04:00
Run as a one-line. NOTE: replace with yourorg/yourrepo (repo level) or just yourorg (org level)
2020-04-14 20:41:49 -04:00
```bash
2020-04-15 13:46:25 -04:00
curl -s https://raw.githubusercontent.com/actions/runner/automate/scripts/create-latest-svc.sh | bash -s yourorg/yourrepo
2020-04-14 20:41:49 -04:00
```
2020-04-15 12:41:16 -04:00
## Uninstall running as service
2020-04-14 20:41:49 -04:00
2020-04-15 12:35:17 -04:00
**Scenario**: Run on a machine or VM (not container) which automates:
- Stops and uninstalls the systemd (linux) or Launchd (osx) service
- Acquires a removal token
- Removes the runner
2020-04-15 12:41:16 -04:00
:point_right: [Sample script here](../scripts/remove-svc.sh) :point_left:
2020-04-15 12:35:17 -04:00
Repo level one liner. NOTE: replace with yourorg/yourrepo (repo level) or just yourorg (org level)
2020-04-14 20:41:49 -04:00
```bash
2020-04-15 13:46:25 -04:00
curl -s https://raw.githubusercontent.com/actions/runner/automate/scripts/remove-svc.sh | bash -s yourorg/yourrepo
2020-04-14 20:41:49 -04:00
```
2020-04-15 12:35:17 -04:00
### Delete an offline runner
**Scenario**: Deletes a registered runner that is offline:
- Ensures the runner is offline
- Resolves id from name
- Deletes the runner
2020-04-15 12:41:16 -04:00
:point_right: [Sample script here](../scripts/delete.sh) :point_left:
2020-04-15 12:35:17 -04:00
Repo level one liner. NOTE: replace with yourorg/yourrepo (repo level) or just yourorg (org level) and replace runnername
```bash
2020-04-15 13:46:25 -04:00
curl -s https://raw.githubusercontent.com/actions/runner/automate/scripts/delete.sh | bash -s yourorg/yourrepo runnername
2020-04-15 12:35:17 -04:00
```