2 # Copyright (C) The Arvados Authors. All rights reserved.
4 # SPDX-License-Identifier: AGPL-3.0
9 PACKAGE_NAME="$(basename "$0" | grep -Eo '\barvados.*$')"
10 PACKAGE_NAME=${PACKAGE_NAME%.sh}
12 PACKAGE_NAME=$1; shift
15 API_GEMS_LS="$(mktemp --tmpdir api-gems-XXXXXX.list)"
16 trap 'rm -f "$API_GEMS_LS"' EXIT INT TERM QUIT
18 cd "/var/www/${PACKAGE_NAME%-server}"
21 local when="$1"; shift
22 env -C shared/vendor_bundle/ruby ls -1 >"$API_GEMS_LS"
23 local ls_count="$(wc -l <"$API_GEMS_LS")"
24 if [ "$ls_count" = 1 ]; then
27 echo "Package $PACKAGE_NAME FAILED: $ls_count gem directories created after $when:" >&2
28 case "${ARVADOS_DEBUG:-0}" in
29 0) cat "$API_GEMS_LS" >&2 ;;
30 *) env -C shared/vendor_bundle/ruby find -maxdepth 3 -type d -ls >&2 ;;
35 check_gem_dirs "initial install"
39 apt-get install -y nginx
40 dpkg-reconfigure "$PACKAGE_NAME"
43 microdnf --assumeyes install httpd
44 microdnf --assumeyes reinstall "$PACKAGE_NAME"
47 echo -e "$0: Unknown target '$TARGET'.\n" >&2
52 check_gem_dirs "package reinstall"
53 env -C current bundle list >"$ARV_PACKAGES_DIR/$PACKAGE_NAME.gems"