Merge branch 'master' into 9372-container-display
[arvados.git] / build / package-testing / common-test-rails-server-package.sh
1 #!/bin/sh
2
3 set -e
4
5 if [ 0 = "$#" ]; then
6     PACKAGE_NAME="$(basename "$0" | grep -Eo '\barvados.*$')"
7     PACKAGE_NAME=${PACKAGE_NAME%.sh}
8 else
9     PACKAGE_NAME=$1; shift
10 fi
11
12 cd "/var/www/${PACKAGE_NAME%-server}/current"
13
14 case "$TARGET" in
15     debian*|ubuntu*)
16         apt-get install -y nginx
17         dpkg-reconfigure "$PACKAGE_NAME"
18         ;;
19     centos*)
20         yum install --assumeyes httpd
21         yum reinstall --assumeyes "$PACKAGE_NAME"
22         ;;
23     *)
24         echo -e "$0: Unknown target '$TARGET'.\n" >&2
25         exit 1
26         ;;
27 esac
28
29 /usr/local/rvm/bin/rvm-exec default bundle list >"$ARV_PACKAGES_DIR/$PACKAGE_NAME.gems"