1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 export DEBIAN_FRONTEND=noninteractive
6 export PATH=${PATH}:/usr/local/go/bin:/var/lib/gems/bin
7 export GEM_HOME=/var/lib/gems
8 export npm_config_cache=/var/lib/npm
9 export npm_config_cache_min=Infinity
10 export R_LIBS=/var/lib/Rlibs
11 export HOME=$(getent passwd arvbox | cut -d: -f6)
13 defaultdev=$(/sbin/ip route|awk '/default/ { print $5 }')
14 dockerip=$(/sbin/ip route | grep default | awk '{ print $3 }')
15 containerip=$(ip addr show $defaultdev | grep 'inet ' | sed 's/ *inet \(.*\)\/.*/\1/')
16 if test -s /var/run/localip_override ; then
17 localip=$(cat /var/run/localip_override)
22 root_cert=/var/lib/arvados/root-cert.pem
23 root_cert_key=/var/lib/arvados/root-cert.key
24 server_cert=/var/lib/arvados/server-cert-${localip}.pem
25 server_cert_key=/var/lib/arvados/server-cert-${localip}.key
36 [arv-git-httpd-ssl]=9000
52 if test "$(id arvbox -u 2>/dev/null)" = 0 ; then
61 if test -f Gemfile.lock ; then
62 # The 'gem install bundler line below' is cf.
63 # https://bundler.io/blog/2019/05/14/solutions-for-cant-find-gem-bundler-with-executable-bundle.html,
64 # until we get bundler 2.7.10/3.0.0 or higher
65 gem install bundler --no-document -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1|tr -d ' ')"
70 # if ! test -x /var/lib/gems/bin/bundler ; then
72 # bundlergem=$(ls -r $GEM_HOME/cache/bundler-${bundleversion}.gem 2>/dev/null | head -n1 || true)
73 # if test -n "$bundlergem" ; then
74 # flock /var/lib/gems/gems.lock gem install --verbose --local --no-document $bundlergem
76 # flock /var/lib/gems/gems.lock gem install --verbose --no-document bundler --version ${bundleversion}
79 if ! flock /var/lib/gems/gems.lock bundler install --verbose --local --no-deployment $frozen "$@" ; then
80 flock /var/lib/gems/gems.lock bundler install --verbose --no-deployment $frozen "$@"
87 for p in $(ls http*.tar.gz) $(ls http*.tar.bz2) $(ls http*.whl) $(ls http*.zip) ; do
89 ln -sf $p $(echo $p | sed 's/.*%2F\(.*\)/\1/')
94 if [ "$PYCMD" = "python3" ]; then
95 if ! pip3 install --prefix /usr/local --no-index --find-links /var/lib/pip $1 ; then
96 pip3 install --prefix /usr/local $1
99 if ! pip install --no-index --find-links /var/lib/pip $1 ; then