21700: Install Bundler system-wide in Rails postinst
[arvados.git] / tools / arvbox / lib / arvbox / docker / service / doc / run-service
1 #!/bin/bash
2 # Copyright (C) The Arvados Authors. All rights reserved.
3 #
4 # SPDX-License-Identifier: AGPL-3.0
5
6 exec 2>&1
7 set -ex -o pipefail
8
9 . /usr/local/lib/arvbox/common.sh
10
11 if test "$1" != "--only-deps" ; then
12   while [ ! -f $ARVADOS_CONTAINER_PATH/api.ready ]; do
13     sleep 1
14   done
15 fi
16
17 cd /usr/src/arvados/doc
18 run_bundler --without=development
19
20 # Generating the Python and R docs is expensive, so for development if the file
21 # "no-sdk" exists then skip installing R stuff.
22 if [[ ! -f no-sdk ]] ; then
23     env -C ../sdk/R R --quiet --vanilla --file=install_deps.R
24 fi
25
26 if test "$1" = "--only-deps" ; then
27     exit
28 fi
29
30 # Active the arvbox virtualenv so we can import pdoc for PySDK doc generation.
31 . /opt/arvados-py/bin/activate
32 flock $GEMLOCK bundle exec rake generate baseurl=http://$localip:${services[doc]} arvados_api_host=$localip:${services[controller-ssl]} arvados_workbench_host=http://$localip