2 # Copyright (C) The Arvados Authors. All rights reserved.
4 # SPDX-License-Identifier: AGPL-3.0
9 . /usr/local/lib/arvbox/common.sh
11 cd /usr/src/workbench2
13 npm -d install --prefix /usr/local --global yarn@1.17.3
17 if test "$1" = "--only-deps" ; then
21 cat <<EOF > /usr/src/workbench2/public/config.json
23 "API_HOST": "${localip}:${services[controller-ssl]}",
24 "VOCABULARY_URL": "/vocabulary-example.json",
25 "FILE_VIEWERS_CONFIG_URL": "/file-viewers-example.json"
29 export ARVADOS_API_HOST=$localip:${services[controller-ssl]}
30 export ARVADOS_API_TOKEN=$(cat $ARVADOS_CONTAINER_PATH/superuser_token)
32 url_prefix="https://$localip:${services[workbench2-ssl]}/"
35 read -rd $'\000' apiclient <<EOF
37 "url_prefix": "$url_prefix",
43 clientuuid=$(arv --format=uuid api_client list --filters '[["url_prefix", "=", "'$url_prefix'"]]')
44 if [[ -n "$clientuuid" ]] ; then
45 arv api_client update --uuid $clientuuid --api-client "$apiclient"
47 arv api_client create --api-client "$apiclient"
51 # Can't use "yarn start", need to run the dev server script
52 # directly so that the TERM signal from "sv restart" gets to the
54 export VERSION=$(./version-at-commit.sh)
55 exec node node_modules/react-scripts-ts/scripts/start.js