@@ -9,7 +9,7 @@ start() {
99
1010
1111 if [[ -n $RUNNER_CONFIG ]]; then
12- say Launching runner with run .sh ...
12+ say Configuring runner with config .sh ...
1313 line
1414 configure
1515 else
@@ -30,8 +30,8 @@ start() {
3030 wait $RUNNER_PID
3131
3232 else
33- say Launching runner with run.sh ... SKIPPED .
34- say Exiting github-runner.
33+ say Skipped running due to --no- run option .
34+ say Exiting github-runner-installer .
3535 fi
3636
3737}
@@ -52,6 +52,9 @@ info() {
5252 say " Repo: ${RUNNER_URL_REPO} "
5353 say " Labels: ${RUNNER_CONFIG_LABELS} "
5454 say " Status: ${RUNNER_URL_RUNNERS} "
55+ line
56+ say " Run: ${RUNNER_RUN:- no} "
57+
5558}
5659usage () {
5760 say GitHub Runner Script
@@ -61,7 +64,7 @@ usage() {
6164 echo " --repo (GITHUB_REPOSITORY) The GitHub repo to install the runner on. (eg. owner/repo)"
6265 echo " --name (RUNNER_CONFIG_NAME) The name to give the runner. (Default: $( whoami) @$( hostname -f) )"
6366 echo " --labels (RUNNER_CONFIG_LABELS) A list of labels to assign to the runner. (Default: $( whoami) @$( hostname -f) )"
64- echo " --no- run (RUNNER_RUN) If empty, don't run ."
67+ echo " --run (RUNNER_RUN) Launch the runner with run.sh after installing ."
6568 echo " --config-sh-options (RUNNER_CONFIG_OPTIONS) Pass options to the github runner config.sh command."
6669}
6770verify () {
@@ -76,9 +79,9 @@ verify() {
7679 # Detect path to this script.
7780 # @TODO: Rename RUNNER_SCRIPT_ to reduce confusion with github runner CLI
7881 if [[ -z " $COMPOSER_RUNTIME_BIN_DIR " ]]; then
79- RUNNER_SCRIPT_PATH=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) /github-runner"
82+ RUNNER_SCRIPT_PATH=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) /github-runner-installer "
8083 else
81- RUNNER_SCRIPT_PATH=" $COMPOSER_RUNTIME_BIN_DIR /github-runner"
84+ RUNNER_SCRIPT_PATH=" $COMPOSER_RUNTIME_BIN_DIR /github-runner-installer "
8285 fi
8386 if [[ ! -f " ${RUNNER_SCRIPT_PATH} " ]]; then
8487 say " Path detection failed."
@@ -90,11 +93,11 @@ verify() {
9093 # Defaults. If ENV vars exist, use them. If not, use these values.
9194 RUNNER_PATH=${RUNNER_PATH:- " runner" }
9295 RUNNER_CONFIG_NAME=${RUNNER_CONFIG_NAME:- $(whoami)@ $(hostname -f)}
93- RUNNER_CONFIG_LABELS=${RUNNER_CONFIG_LABELS:- " jonpugh /github-runner" }
96+ RUNNER_CONFIG_LABELS=${RUNNER_CONFIG_LABELS:- " operations-project /github-runner-installer " }
9497 RUNNER_CONFIG_OPTIONS=${RUNNER_CONFIG_OPTIONS:- " " }
9598
9699 # Whether to run the runner
97- RUNNER_RUN=${RUNNER_RUN:- " yes " }
100+ RUNNER_RUN=${RUNNER_RUN:- " " }
98101 RUNNER_CONFIG=${RUNNER_CONFIG:- " yes" }
99102
100103 # Command line Options
@@ -132,8 +135,8 @@ verify() {
132135 RUNNER_CONFIG_OPTIONS=" ${1#* =} "
133136 ;;
134137
135- --no- run)
136- RUNNER_RUN=" "
138+ --run)
139+ RUNNER_RUN=" yes "
137140 ;;
138141
139142 --no-config)
@@ -229,6 +232,20 @@ currentArchitecture() {
229232 ;;
230233 esac
231234}
235+ currentArchitecture () {
236+ architecture=$( uname -m)
237+ case " $architecture " in
238+ x86_64)
239+ echo " x64"
240+ ;;
241+ aarch64 | arm64)
242+ echo " arm64"
243+ ;;
244+ * )
245+ exit 1
246+ ;;
247+ esac
248+ }
232249latestVersion () {
233250 RUNNER_CLI_REPO=actions/runner
234251 curl -s -L \
@@ -275,15 +292,7 @@ download() {
275292configure () {
276293 line
277294 say Configuring GitHub runner...
278- say Removing existing runner...
279-
280- # Remove
281- # @TODO: If runner has a job, wait for it to complete.
282295 cd $RUNNER_FOLDER
283- ./config.sh remove --token ${RUNNER_CONFIG_TOKEN} || say " config remove didn't work."
284-
285- line
286- say Configuring new runner...
287296
288297 # Configure
289298 CMD=" ./config.sh \
@@ -299,11 +308,9 @@ configure() {
299308 say $CMD
300309 line
301310
302- $CMD
311+ $CMD && say GitHub runner configured ! || say GitHub Runner Config failed. Moving on...
303312
304313 line
305- say GitHub runner configured:
306- info
307314
308315}
309316
@@ -329,7 +336,7 @@ cancel() {
329336 exit 1
330337}
331338say () {
332- echo " github-runner | ${* } "
339+ echo " github-runner-installer | ${* } "
333340}
334341line () {
335342 CHARACTER=" ${CHARACTER:- -} "
0 commit comments