Merge branch '18947-dispatch-local'
[arvados.git] / build / package-testing / common-test-rails-server-package.sh
1 #!/bin/sh
2 # Copyright (C) The Arvados Authors. All rights reserved.
3 #
4 # SPDX-License-Identifier: AGPL-3.0
5
6 set -e
7
8 if [ 0 = "$#" ]; then
9     PACKAGE_NAME="$(basename "$0" | grep -Eo '\barvados.*$')"
10     PACKAGE_NAME=${PACKAGE_NAME%.sh}
11 else
12     PACKAGE_NAME=$1; shift
13 fi
14
15 if [ "$PACKAGE_NAME" = "arvados-workbench" ]; then
16   mkdir -p /etc/arvados
17   cat <<'EOF' >/etc/arvados/config.yml
18 ---
19 Clusters:
20   xxxxx:
21     Services:
22       Workbench1:
23         ExternalURL: "https://workbench.xxxxx.example.com"
24       WebDAV:
25         ExternalURL: https://*.collections.xxxxx.example.com/
26       WebDAVDownload:
27         ExternalURL: https://download.xxxxx.example.com
28     ManagementToken: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
29     SystemRootToken: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
30     Collections:
31       BlobSigningKey: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
32     Workbench:
33       SecretKeyBase: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
34     Users:
35       AutoAdminFirstUser: true
36 EOF
37 fi
38
39 cd "/var/www/${PACKAGE_NAME%-server}/current"
40
41 case "$TARGET" in
42     debian*|ubuntu*)
43         apt-get install -y nginx
44         dpkg-reconfigure "$PACKAGE_NAME"
45         ;;
46     centos*)
47         yum install --assumeyes httpd
48         yum reinstall --assumeyes "$PACKAGE_NAME"
49         ;;
50     *)
51         echo -e "$0: Unknown target '$TARGET'.\n" >&2
52         exit 1
53         ;;
54 esac
55
56 /usr/local/rvm/bin/rvm-exec default bundle list >"$ARV_PACKAGES_DIR/$PACKAGE_NAME.gems"