2 # Copyright (C) The Arvados Authors. All rights reserved.
4 # SPDX-License-Identifier: AGPL-3.0
6 # This file declares variables common to all scripts for one Rails package.
8 PACKAGE_NAME=arvados-api-server
9 INSTALL_PATH=/var/www/arvados-api
10 CONFIG_PATH=/etc/arvados/api
11 DOC_URL="http://doc.arvados.org/install/install-api-server.html#configure"
13 RAILSPKG_DATABASE_LOAD_TASK=db:structure:load
14 setup_extra_conffiles() {
15 # Rails 5.2 does not tolerate dangling symlinks in the initializers directory, and this one
16 # can still be there, left over from a previous version of the API server package.
17 rm -f $RELEASE_PATH/config/initializers/omniauth.rb
20 setup_before_nginx_restart() {
21 # initialize git_internal_dir
22 # usually /var/lib/arvados/internal.git (set in application.default.yml )
23 if [ "$APPLICATION_READY" = "1" ]; then
24 GIT_INTERNAL_DIR=$($COMMAND_PREFIX bin/rake config:dump 2>&1 | grep GitInternalDir | awk '{ print $2 }' |tr -d '"')
25 if [ ! -e "$GIT_INTERNAL_DIR" ]; then
26 run_and_report "Creating git_internal_dir '$GIT_INTERNAL_DIR'" \
27 mkdir -p "$GIT_INTERNAL_DIR"
28 run_and_report "Initializing git_internal_dir '$GIT_INTERNAL_DIR'" \
29 git init --quiet --bare $GIT_INTERNAL_DIR
31 echo "Initializing git_internal_dir $GIT_INTERNAL_DIR: directory exists, skipped."
33 run_and_report "Making sure '$GIT_INTERNAL_DIR' has the right permission" \
34 chown -R "$WWW_OWNER:" "$GIT_INTERNAL_DIR"
36 echo "Initializing git_internal_dir... skipped."