Skip to content

Commit

Permalink
added replace to allow create latest svc to apply --replace flag (act…
Browse files Browse the repository at this point in the history
  • Loading branch information
nikola-jokic authored Nov 22, 2022
1 parent 1632e4a commit cc49e65
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/create-latest-svc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set -e

flags_found=false

while getopts 's:g:n:r:u:l:d' opt; do
while getopts 's:g:n:r:u:l:df' opt; do
flags_found=true

case $opt in
Expand All @@ -35,6 +35,9 @@ while getopts 's:g:n:r:u:l:d' opt; do
l)
labels=$OPTARG
;;
f)
replace='true'
;;
d)
disableupdate='true'
;;
Expand All @@ -53,7 +56,8 @@ Usage:
-r optional name of the runner group to add the runner to, defaults to the Default group
-u optional user svc will run as, defaults to current
-l optional list of labels (split by comma) applied on the runner
-d optional allow runner to remain on the current version for one month after the release of a newer version"
-d optional allow runner to remain on the current version for one month after the release of a newer version
-f optional replace any existing runner with the same name"
exit 0
;;
esac
Expand Down Expand Up @@ -174,7 +178,7 @@ fi
echo
echo "Configuring ${runner_name} @ $runner_url"
echo "./config.sh --unattended --url $runner_url --token *** --name $runner_name ${labels:+--labels $labels} ${runner_group:+--runnergroup \"$runner_group\"} ${disableupdate:+--disableupdate}"
sudo -E -u ${svc_user} ./config.sh --unattended --url $runner_url --token $RUNNER_TOKEN --name $runner_name ${labels:+--labels $labels} ${runner_group:+--runnergroup "$runner_group"} ${disableupdate:+--disableupdate}
sudo -E -u ${svc_user} ./config.sh --unattended --url $runner_url --token $RUNNER_TOKEN ${replace:+--replace} --name $runner_name ${labels:+--labels $labels} ${runner_group:+--runnergroup "$runner_group"} ${disableupdate:+--disableupdate}

#---------------------------------------
# Configuring as a service
Expand Down

0 comments on commit cc49e65

Please sign in to comment.