16267: switch to `arvados-server install -type test` for installing
[arvados.git] / tools / arvbox / lib / arvbox / docker / go-setup.sh
1 #!/bin/bash
2 # Copyright (C) The Arvados Authors. All rights reserved.
3 #
4 # SPDX-License-Identifier: AGPL-3.0
5
6 export GOPATH=/var/lib/gopath
7 mkdir -p $GOPATH
8
9 cd /usr/src/arvados
10 if [[ $UID = 0 ]] ; then
11   /usr/local/lib/arvbox/runsu.sh flock /var/lib/gopath/gopath.lock go mod download
12   if [[ ! -f /usr/local/bin/arvados-server ]]; then
13     /usr/local/lib/arvbox/runsu.sh flock /var/lib/gopath/gopath.lock go install git.arvados.org/arvados.git/cmd/arvados-server
14   fi
15 else
16   flock /var/lib/gopath/gopath.lock go mod download
17   if [[ ! -f /usr/local/bin/arvados-server ]]; then
18     flock /var/lib/gopath/gopath.lock go install git.arvados.org/arvados.git/cmd/arvados-server
19   fi
20 fi
21 install $GOPATH/bin/arvados-server /usr/local/bin