Merge branch '12479-wb-structured-vocabulary'
[arvados.git] / tools / arvbox / bin / arvbox
index f7ef693df83cbc6ca15c43c07c34aada6a1b15dc..234d15aecd03d42537b5f93f02a4dcd8b3f0340b 100755 (executable)
@@ -1,4 +1,7 @@
 #!/bin/sh
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
 
 set -e
 
@@ -43,11 +46,16 @@ if test -z "$SSO_ROOT" ; then
     SSO_ROOT="$ARVBOX_DATA/sso-devise-omniauth-provider"
 fi
 
+if test -z "$COMPOSER_ROOT" ; then
+    COMPOSER_ROOT="$ARVBOX_DATA/composer"
+fi
+
 PG_DATA="$ARVBOX_DATA/postgres"
 VAR_DATA="$ARVBOX_DATA/var"
 PASSENGER="$ARVBOX_DATA/passenger"
 GEMS="$ARVBOX_DATA/gems"
 PIPCACHE="$ARVBOX_DATA/pip"
+NPMCACHE="$ARVBOX_DATA/npm"
 GOSTUFF="$ARVBOX_DATA/gopath"
 
 getip() {
@@ -180,7 +188,7 @@ run() {
         updateconf
         wait_for_arvbox
     else
-        mkdir -p "$PG_DATA" "$VAR_DATA" "$PASSENGER" "$GEMS" "$PIPCACHE" "$GOSTUFF"
+        mkdir -p "$PG_DATA" "$VAR_DATA" "$PASSENGER" "$GEMS" "$PIPCACHE" "$NPMCACHE" "$GOSTUFF"
 
 
         if ! test -d "$ARVADOS_ROOT" ; then
@@ -189,6 +197,9 @@ run() {
         if ! test -d "$SSO_ROOT" ; then
             git clone https://github.com/curoverse/sso-devise-omniauth-provider.git "$SSO_ROOT"
         fi
+        if ! test -d "$COMPOSER_ROOT" ; then
+            git clone https://github.com/curoverse/composer.git "$COMPOSER_ROOT"
+        fi
 
         if test "$CONFIG" = test ; then
 
@@ -201,14 +212,16 @@ run() {
                        --privileged \
                        "--volume=$ARVADOS_ROOT:/usr/src/arvados:rw" \
                        "--volume=$SSO_ROOT:/usr/src/sso:rw" \
+                       "--volume=$COMPOSER_ROOT:/usr/src/composer:rw" \
                        "--volume=$PG_DATA:/var/lib/postgresql:rw" \
                        "--volume=$VAR_DATA:/var/lib/arvados:rw" \
                        "--volume=$PASSENGER:/var/lib/passenger:rw" \
                        "--volume=$GEMS:/var/lib/gems:rw" \
                        "--volume=$PIPCACHE:/var/lib/pip:rw" \
+                       "--volume=$NPMCACHE:/var/lib/npm:rw" \
                        "--volume=$GOSTUFF:/var/lib/gopath:rw" \
-                       arvados/arvbox-dev$TAG \
-                       /usr/local/bin/runsvinit -svdir=/etc/test-service
+                      "--env=SVDIR=/etc/test-service" \
+                       arvados/arvbox-dev$TAG
 
                 docker exec -ti \
                        $ARVBOX_CONTAINER \
@@ -241,11 +254,13 @@ run() {
                    --privileged \
                    "--volume=$ARVADOS_ROOT:/usr/src/arvados:rw" \
                    "--volume=$SSO_ROOT:/usr/src/sso:rw" \
+                   "--volume=$COMPOSER_ROOT:/usr/src/composer:rw" \
                    "--volume=$PG_DATA:/var/lib/postgresql:rw" \
                    "--volume=$VAR_DATA:/var/lib/arvados:rw" \
                    "--volume=$PASSENGER:/var/lib/passenger:rw" \
                    "--volume=$GEMS:/var/lib/gems:rw" \
                    "--volume=$PIPCACHE:/var/lib/pip:rw" \
+                   "--volume=$NPMCACHE:/var/lib/npm:rw" \
                    "--volume=$GOSTUFF:/var/lib/gopath:rw" \
                    $PUBLIC \
                    arvados/arvbox-dev$TAG