16306: Option to start shell in docker-boot.sh.
authorTom Clegg <tom@tomclegg.ca>
Thu, 30 Jul 2020 15:28:11 +0000 (11:28 -0400)
committerTom Clegg <tom@tomclegg.ca>
Fri, 21 Aug 2020 17:55:33 +0000 (13:55 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@tomclegg.ca>

cmd/arvados-dev/docker-boot.sh
cmd/arvados-dev/docker-build-install.sh

index e8703e41f0d62fca19e410a42850155127a6ab1b..0b9874295c58af71da7fc846255c413e3f9d8e1c 100755 (executable)
 
 set -e -o pipefail
 
+declare -A opts=()
+while [[ $# -gt 0 ]]; do
+    case "$1" in
+        --shell)
+            shift
+            opts[shell]=1
+            ;;
+        *)
+            break
+            ;;
+    esac
+done
+
 cleanup() {
     if [[ -n "${tmpdir}" ]]; then
         rm -rf "${tmpdir}"
@@ -36,7 +49,11 @@ done
 
 osbase=debian:10
 installimage=arvados-installpackage-${osbase}
+command="/var/lib/arvados/bin/arvados-server boot -listen-host 0.0.0.0"
+if [[ "${opts[shell]}" ]]; then
+    command="bash -login"
+fi
 docker run -it --rm \
        "${volargs[@]}" \
        "${installimage}" \
-       bash -c '/etc/init.d/postgresql start && /var/lib/arvados/bin/arvados-server init -cluster-id x1234 && /var/lib/arvados/bin/arvados-server boot'
+       bash -c "/etc/init.d/postgresql start && /var/lib/arvados/bin/arvados-server init -cluster-id x1234 && $command"
index 3c6e177cf8af85f0828aca8e93291f7ad2005440..63b5b5c2d4271ddbef158d96f36cbf7070dcf5a1 100755 (executable)
@@ -27,7 +27,8 @@ while [[ $# -gt 0 ]]; do
             ;;
         *)
             echo >&2 "invalid argument '$arg'"
-            exit 1
+            exit 2
+            ;;
     esac
 done