Merge branch '20831-user-table-locks' refs #20831
[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 cd "/var/www/${PACKAGE_NAME%-server}/current"
16
17 case "$TARGET" in
18     debian*|ubuntu*)
19         apt-get install -y nginx
20         dpkg-reconfigure "$PACKAGE_NAME"
21         ;;
22     centos*)
23         yum install --assumeyes httpd
24         yum reinstall --assumeyes "$PACKAGE_NAME"
25         ;;
26     rocky*)
27         microdnf --assumeyes install httpd
28         microdnf --assumeyes reinstall "$PACKAGE_NAME"
29         ;;
30     *)
31         echo -e "$0: Unknown target '$TARGET'.\n" >&2
32         exit 1
33         ;;
34 esac
35
36 /usr/local/rvm/bin/rvm-exec default bundle list >"$ARV_PACKAGES_DIR/$PACKAGE_NAME.gems"