Salt installer change: standardize on putting the certs directory under
[arvados-dev.git] / jenkins / run-deploy-salt.sh
index a14ce0a1e2f2a554fa63e1e85187f306f4558c94..2463d19ebae03b34f3f6f988c9af83d8bf9cd175 100755 (executable)
@@ -35,7 +35,7 @@ function usage {
     echo >&2
     echo >&2 "usage: $0 [options] <identifier>"
     echo >&2
-    echo >&2 "   <identifier>                 Arvados cluster name"
+    echo >&2 "   <identifier>                 Arvados cluster name or single node salt identifier"
     echo >&2
     echo >&2 "$0 options:"
     echo >&2 "  -d, --debug                   Enable debug output"
@@ -100,7 +100,7 @@ function run_salt() {
   fi
   shift
   shift
-  ssh -o "ConnectTimeout 5" -o "LogLevel QUIET" $SALT_MASTER sudo salt --out=txt \'*$cluster*\' cmd.run \'$(IFS=\0;echo "$@")\' $E
+  ssh -o "ConnectTimeout 5" -o "LogLevel QUIET" $SALT_MASTER salt --out=txt \'$cluster*\' cmd.run \'$(IFS=\0;echo "$@")\' $E
 }
 
 if [[ -z "$SALT_MASTER" ]]; then
@@ -108,7 +108,12 @@ if [[ -z "$SALT_MASTER" ]]; then
   exit 1
 fi
 
-run_salt $IDENTIFIER '' 'apt update && apt -y upgrade'
+run_salt "*$IDENTIFIER" '' 'apt update && DEBIAN_FRONTEND=noninteractive apt -y upgrade'
+
+if [[ "$IDENTIFIER" =~ \. ]]; then
+  title "Single node deploy requested, done"
+  exit 0
+fi
 
 title "Loading ARVADOS_API_HOST and ARVADOS_API_TOKEN"
 if [[ -f "$HOME/.config/arvados/$IDENTIFIER.arvadosapi.com.conf" ]]; then
@@ -138,7 +143,7 @@ if [[ "$DOCKER_IMAGES_PROJECT" == "" ]]; then
 fi
 
 title "Found Arvados Standard Docker Images project with uuid $DOCKER_IMAGES_PROJECT"
-VERSION=$(run_salt shell.$IDENTIFIER '' 'apt-cache policy python3-arvados-cwl-runner' | grep Candidate |awk '{print $3}' |cut -f1 -d-)
+VERSION=$(run_salt "shell.$IDENTIFIER" '' 'apt-cache policy python3-arvados-cwl-runner' | grep Candidate |awk '{print $3}' |cut -f1 -d-)
 
 if [[ "$?" != "0" ]] || [[ "$VERSION" == "" ]]; then
   title "ERROR: unable to get python3-arvados-cwl-runner version"
@@ -148,7 +153,7 @@ else
 fi
 
 set +e
-CLEAN_VERSION=`echo $VERSION |sed -e 's/~/./'`
+CLEAN_VERSION=`echo $VERSION | sed s/~dev/.dev/g | sed s/~rc/rc/g`
 run_salt "shell.$IDENTIFIER" "'{\"ARVADOS_API_HOST\": \"$ARVADOS_API_HOST\", \"ARVADOS_API_TOKEN\": \"$ARVADOS_API_TOKEN\"}'" "arv-keepdocker" |grep -qP "arvados/jobs +$CLEAN_VERSION "
 if [[ $? -eq 0 ]]; then
   set -e