From: Nico Cesar Date: Tue, 19 Jan 2016 20:17:22 +0000 (-0500) Subject: added git_internal_dir init in postinst.sh X-Git-Url: https://git.arvados.org/arvados-dev.git/commitdiff_plain/5cc977da78b718596faa9ad0352b7c14402f90fa added git_internal_dir init in postinst.sh --- diff --git a/jenkins/rails-package-scripts/postinst.sh b/jenkins/rails-package-scripts/postinst.sh index 1032d14..dfc58c5 100644 --- a/jenkins/rails-package-scripts/postinst.sh +++ b/jenkins/rails-package-scripts/postinst.sh @@ -220,6 +220,23 @@ configure_version() { $COMMAND_PREFIX bundle exec rake config:check || APPLICATION_READY=0 fi + # initialize git_internal_dir + # usually /var/lib/arvados/internal.git (set in application.default.yml ) + if [ "$APPLICATION_READY" = "1" ]; then + GIT_INTERNAL_DIR=$($COMMAND_PREFIX bundle exec rake config:check 2>&1 | grep git_internal_dir | awk '{ print $2 }') + if [ -e "$GIT_INTERNAL_DIR" ] + then + run_and_report "Creating and initializing git_internal_dir '$GIT_INTERNAL_DIR'" \ + mkdir -p "$GIT_INTERNAL_DIR" && \ + chown "$WWW_OWNER:" "$GIT_INTERNAL_DIR" && \ + su -c "git init --bare $GIT_INTERNAL_DIR" "$WWW_OWNER:" + fi + run_and_report "Making sure '$GIT_INTERNAL_DIR' has the right permission" \ + chown -R "$WWW_OWNER:" "$GIT_INTERNAL_DIR" + else + echo "Initializing git_internal_dir... skipped." + fi + # precompile assets; thankfully this does not take long if [ "$APPLICATION_READY" = "1" ]; then run_and_report "Precompiling assets" \