Merge branch '21863-remove-cwltest-package'
[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     rocky*)
23         microdnf --assumeyes install httpd
24         microdnf --assumeyes reinstall "$PACKAGE_NAME"
25         ;;
26     *)
27         echo -e "$0: Unknown target '$TARGET'.\n" >&2
28         exit 1
29         ;;
30 esac
31
32 bundle list >"$ARV_PACKAGES_DIR/$PACKAGE_NAME.gems"