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

Commit de533b9

Browse files
committed
fix
1 parent 3d8c3c9 commit de533b9

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: build and publish
1+
name: publish
22

33

44
on:

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,5 @@ RUN sudo curl -o runner.tar.gz -sSL https://github.com/actions/runner/releases/d
3232

3333
ENTRYPOINT ["./entrypoint.sh"]
3434
CMD ["./bin/Runner.Listener", "run", "--startuptype", "service"]
35+
36+
#CMD [ "bash", "-c", "./config.sh --url ${RUNNER_URL} --token ${RUNNER_TOKEN} --name runner --runnergroup Default --labels linux,self-hosted --work /tmp/runner; ./run.sh; sleep infinity"]

entrypoint.sh

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#!/bin/bash
22

3-
export RUNNER_URL=https://github.com/${ORG}
43
export -n ACCESS_TOKEN
5-
export RUNNER_NAME_PREFIX=runner
6-
export RUNNER_WORKDIR=/tmp/runner
7-
export LABELS="linux,self-hosted"
4+
_RUNNER_URL=https://github.com/${ORG}
5+
_RUNNER_NAME_PREFIX=${RUNNER_NAME_PREFIX:-"runner"}
6+
_RUNNER_WORKDIR=${RUNNER_WORKDIR:-"/tmp/runner"}
7+
_LABELS=${LABELS:-"linux,self-hosted"}
8+
89

910
deregister_runner() {
1011
echo "Caught SIGTERM. Deregistering runner"
12+
echo "Obtaining the token of the runner"
1113
if [[ -n "${ACCESS_TOKEN}" ]]; then
1214
_TOKEN=$(ACCESS_TOKEN="${ACCESS_TOKEN}" bash /home/runner/token.sh)
1315
RUNNER_TOKEN=$(echo "${_TOKEN}" | jq -r .token)
@@ -16,29 +18,34 @@ deregister_runner() {
1618
exit
1719
}
1820

19-
_RUNNER_NAME=${RUNNER_NAME:-${RUNNER_NAME_PREFIX:-github-runner}-$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 ; echo '')}
21+
_RUNNER_NAME=${RUNNER_NAME:-${_RUNNER_NAME_PREFIX:-github-runner}-$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 ; echo '')}
2022

2123
configure_runner(){
2224
if [[ -n "${ACCESS_TOKEN}" ]]; then
2325
echo "Obtaining the token of the runner"
2426
_TOKEN=$(ACCESS_TOKEN="${ACCESS_TOKEN}" bash /home/runner/token.sh)
27+
echo ${_TOKEN}
2528
RUNNER_TOKEN=$(echo "${_TOKEN}" | jq -r .token)
29+
echo ${RUNNER_TOKEN}
30+
echo "done"
2631
fi
2732

2833
echo "Configuring"
2934
./config.sh \
30-
--url "${RUNNER_URL}" \
35+
--url "${_RUNNER_URL}" \
3136
--token "${RUNNER_TOKEN}" \
3237
--name "${_RUNNER_NAME}" \
33-
--work "${RUNNER_WORKDIR}" \
34-
--labels "${LABELS}" \
38+
--work "${_RUNNER_WORKDIR}" \
39+
--labels "${_LABELS}" \
3540
--runnergroup "Default" \
3641
--unattended \
37-
--replace
42+
--replace ${_EPHEMERAL}
3843
}
3944

4045
configure_runner
4146

4247
trap deregister_runner SIGINT SIGQUIT SIGTERM INT TERM QUIT
4348

44-
"$@"
49+
"${@}" &
50+
51+
wait $!

0 commit comments

Comments
 (0)