From 3bce2eb09c1684e2ff10812819b2a8cd14fa81cd Mon Sep 17 00:00:00 2001 From: Bruno FERNANDO Date: Fri, 11 Dec 2020 17:03:04 +0100 Subject: [PATCH] feat(scripts): add labels in the script that register runner (#844) --- scripts/create-latest-svc.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/create-latest-svc.sh b/scripts/create-latest-svc.sh index de04ee12c..dc008b83c 100755 --- a/scripts/create-latest-svc.sh +++ b/scripts/create-latest-svc.sh @@ -12,12 +12,13 @@ set -e # # Usage: # export RUNNER_CFG_PAT= -# ./create-latest-svc scope [ghe_domain] [name] [user] +# ./create-latest-svc scope [ghe_domain] [name] [user] [labels] # # scope required repo (:owner/:repo) or org (:organization) # ghe_domain optional the fully qualified domain name of your GitHub Enterprise Server deployment # name optional defaults to hostname # user optional user svc will run as. defaults to current +# labels optional list of labels (split by comma) applied on the runner # # Notes: # PATS over envvars are more secure @@ -30,6 +31,7 @@ runner_scope=${1} ghe_hostname=${2} runner_name=${3:-$(hostname)} svc_user=${4:-$USER} +labels=${5} echo "Configuring runner @ ${runner_scope}" sudo echo @@ -130,8 +132,8 @@ fi echo echo "Configuring ${runner_name} @ $runner_url" -echo "./config.sh --unattended --url $runner_url --token *** --name $runner_name" -sudo -E -u ${svc_user} ./config.sh --unattended --url $runner_url --token $RUNNER_TOKEN --name $runner_name +echo "./config.sh --unattended --url $runner_url --token *** --name $runner_name --labels $labels" +sudo -E -u ${svc_user} ./config.sh --unattended --url $runner_url --token $RUNNER_TOKEN --name $runner_name --labels $labels #--------------------------------------- # Configuring as a service