Skip to content

Commit 185186c

Browse files
committed
lifecycle hook, runner as service
docs: update README for Anthos usage fix: clean up workflow and use kustomize remove env check for now fix: docker auth fix: deploy CI: bump CI: bump chore: scale down replicas to 1 CI: bump chore: add echo statements for debugging fix: ubuntu 18 fix: let bin/installdependencies.sh take care of updates
1 parent 4dac78a commit 185186c

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

deployment.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,20 @@ spec:
2323
valueFrom:
2424
secretKeyRef:
2525
name: self-hosted-runner-creds
26-
key: TOKEN
26+
key: GITHUB_TOKEN
2727
- name: DOCKER_HOST
2828
value: 127.0.0.1
2929
- name: DOCKER_BUILDKIT
3030
value: "1"
31+
lifecycle:
32+
preStop:
33+
exec:
34+
command:
35+
[
36+
'/bin/bash',
37+
'-c',
38+
'RUNNER_ALLOW_RUNASROOT=1 ./config.sh remove --token $(curl -sS --data "" -H "Authorization: Bearer $TOKEN" https://api.github.com/repos/$GITHUB_REPO/actions/runners/remove-token | jq -r .token)'
39+
]
3140
resources:
3241
limits:
3342
memory: "512Mi"
@@ -49,4 +58,4 @@ spec:
4958
mountPath: /var/lib/docker
5059
volumes:
5160
- name: dind-storage
52-
emptyDir: {}
61+
emptyDir: {}

startup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ trap remove_runner EXIT
1515
CONFIG_TOKEN=$(curl --data "" --header "Authorization: Bearer $TOKEN" https://api.github.com/repos/$GITHUB_REPO/actions/runners/registration-token | jq -r '.token')
1616

1717
# Create the runner and configure it
18-
./config.sh --url https://github.com/$GITHUB_REPO --token $CONFIG_TOKEN --unattended
18+
./config.sh --url https://github.com/$GITHUB_REPO --token $CONFIG_TOKEN --unattended --replace
1919

2020
# Run it
21-
./runsvc.sh
21+
./runsvc.sh

0 commit comments

Comments
 (0)