Merge branch 'master' into 12018-sync-groups-tool
[arvados.git] / tools / arvbox / lib / arvbox / docker / service / websockets / run-service
index d2f010b474d3a100759fce047d10389adbf382f7..cb56ac7f4de5dbb7f3ad6d22c6b8166933a32f81 100755 (executable)
@@ -1,10 +1,19 @@
 #!/bin/bash
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
 
 exec 2>&1
 set -ex -o pipefail
 
 . /usr/local/lib/arvbox/common.sh
 
+if test -s /var/lib/arvados/api_rails_env ; then
+  RAILS_ENV=$(cat /var/lib/arvados/api_rails_env)
+else
+  RAILS_ENV=development
+fi
+
 mkdir -p /var/lib/gopath
 cd /var/lib/gopath
 
@@ -25,7 +34,7 @@ Client:
   APIHost: $localip:${services[api]}
   Insecure: true
 Postgres:
-  dbname: arvados_development
+  dbname: arvados_$RAILS_ENV
   user: arvados
   password: $database_pw
   host: localhost