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 setup_conffile initializers/omniauth.rb
18 setup_before_nginx_restart() {
19 # initialize git_internal_dir
20 # usually /var/lib/arvados/internal.git (set in application.default.yml )
21 if [ "$APPLICATION_READY" = "1" ]; then
22 GIT_INTERNAL_DIR=$($COMMAND_PREFIX bundle exec rake config:dump 2>&1 | grep GitInternalDir | awk '{ print $2 }' |tr -d '"')
23 if [ ! -e "$GIT_INTERNAL_DIR" ]; then
24 run_and_report "Creating git_internal_dir '$GIT_INTERNAL_DIR'" \
25 mkdir -p "$GIT_INTERNAL_DIR"
26 run_and_report "Initializing git_internal_dir '$GIT_INTERNAL_DIR'" \
27 git init --quiet --bare $GIT_INTERNAL_DIR
29 echo "Initializing git_internal_dir $GIT_INTERNAL_DIR: directory exists, skipped."
31 run_and_report "Making sure '$GIT_INTERNAL_DIR' has the right permission" \
32 chown -R "$WWW_OWNER:" "$GIT_INTERNAL_DIR"
34 echo "Initializing git_internal_dir... skipped."