use source and export only required variables
This commit is contained in:
parent
623f0fdf01
commit
4a4a221846
6 changed files with 22 additions and 21 deletions
5
debian/conf/gitlab
vendored
5
debian/conf/gitlab
vendored
|
@ -7,9 +7,8 @@
|
||||||
# Normal values are "production", "test" and "development".
|
# Normal values are "production", "test" and "development".
|
||||||
RAILS_ENV="production"
|
RAILS_ENV="production"
|
||||||
|
|
||||||
# Read and export debian specific configuration
|
# Read debian specific configuration
|
||||||
# Only exported variables will be passed on to gitlab app
|
. /etc/gitlab/gitlab-debian.conf
|
||||||
export $(cat /etc/gitlab/gitlab-debian.conf)
|
|
||||||
|
|
||||||
# app_user defines the user that GitLab is run as.
|
# app_user defines the user that GitLab is run as.
|
||||||
# The default is "git".
|
# The default is "git".
|
||||||
|
|
10
debian/gitlab-check.sh
vendored
10
debian/gitlab-check.sh
vendored
|
@ -2,12 +2,12 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Read and export debian specific configuration
|
# Read debian specific configuration
|
||||||
# Only exported variables will be passed on to gitlab app
|
. /etc/gitlab/gitlab-debian.conf
|
||||||
export $(cat /etc/gitlab/gitlab-debian.conf)
|
export DB RAILS_ENV
|
||||||
|
|
||||||
cd /usr/share/gitlab
|
cd /usr/share/gitlab
|
||||||
|
|
||||||
# Check gitlab is configured correctly
|
# Check gitlab is configured correctly
|
||||||
printf "Check if Gitlab is configured correctly...\n"
|
printf "Check if Gitlab is configured correctly...\n"
|
||||||
su ${gitlab_user} -s /bin/sh -c 'bundle exec rake gitlab:check RAILS_ENV=production'
|
su ${gitlab_user} -s /bin/sh -c 'bundle exec rake gitlab:check'
|
||||||
|
|
||||||
|
|
12
debian/postinst
vendored
12
debian/postinst
vendored
|
@ -40,19 +40,19 @@ gitlab_debian_defaults_copy=/var/lib/gitlab/gitlab-debian.defaults
|
||||||
# `abort-remove' or `abort-deconfigure'.
|
# `abort-remove' or `abort-deconfigure'.
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
# Read and export debian specific configuration
|
# Read debian specific configuration
|
||||||
# Only exported variables will be passed on to gitlab app
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
|
||||||
# Bootstrap config file - first try
|
# Bootstrap config file - first try
|
||||||
export $(cat ${gitlab_debian_conf_example})
|
. ${gitlab_debian_conf_example}
|
||||||
# second try
|
# second try
|
||||||
test -f ${gitlab_debian_conf_private} || \
|
test -f ${gitlab_debian_conf_private} || \
|
||||||
cp ${gitlab_debian_conf_example} ${gitlab_debian_conf_private}
|
cp ${gitlab_debian_conf_example} ${gitlab_debian_conf_private}
|
||||||
export $(cat ${gitlab_debian_conf_private})
|
. ${gitlab_debian_conf_private}
|
||||||
|
|
||||||
# If /etc/gitlab/gitlab-debian.conf is already present, use it
|
# If /etc/gitlab/gitlab-debian.conf is already present, use it
|
||||||
test -f ${gitlab_debian_conf} && export $(cat ${gitlab_debian_conf})
|
test -f ${gitlab_debian_conf} && . ${gitlab_debian_conf}
|
||||||
|
export DB RAILS_ENV
|
||||||
|
|
||||||
# Read default values (we cannot do this before gitlab-debian.conf is exported
|
# Read default values (we cannot do this before gitlab-debian.conf is exported
|
||||||
# as we want to override variables set by gitlab-debian.conf in earlier gitlab
|
# as we want to override variables set by gitlab-debian.conf in earlier gitlab
|
||||||
|
@ -76,7 +76,7 @@ fi
|
||||||
#######################################################################
|
#######################################################################
|
||||||
# update Gemfile.lock, always
|
# update Gemfile.lock, always
|
||||||
#######################################################################
|
#######################################################################
|
||||||
su ${gitlab_user} -s /bin/sh -c 'truncate -s 0 ${gitlab_data_dir}/Gemfile.lock'
|
su ${gitlab_user} -s /bin/sh -c "truncate -s 0 ${gitlab_data_dir}/Gemfile.lock"
|
||||||
cd ${gitlab_app_root}
|
cd ${gitlab_app_root}
|
||||||
if ! su ${gitlab_user} -s /bin/sh -c 'bundle --local --quiet'; then
|
if ! su ${gitlab_user} -s /bin/sh -c 'bundle --local --quiet'; then
|
||||||
if [ "$1" = "triggered" ]; then
|
if [ "$1" = "triggered" ]; then
|
||||||
|
|
4
debian/postrm
vendored
4
debian/postrm
vendored
|
@ -17,8 +17,8 @@ gitlab_debian_defaults=/var/lib/gitlab/gitlab-debian.defaults
|
||||||
|
|
||||||
# Ensure the menu system is updated
|
# Ensure the menu system is updated
|
||||||
|
|
||||||
# Read and export debian specific configuration
|
# Read debian specific configuration
|
||||||
test -f ${gitlab_debian_conf} && export $(cat ${gitlab_debian_conf})
|
test -f ${gitlab_debian_conf} && . ${gitlab_debian_conf}
|
||||||
. ${gitlab_debian_defaults}
|
. ${gitlab_debian_defaults}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
|
9
debian/rake-tasks.sh
vendored
9
debian/rake-tasks.sh
vendored
|
@ -2,9 +2,10 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Read and export debian specific configuration
|
# Read debian specific configuration
|
||||||
# Only exported variables will be passed on to gitlab app
|
. /etc/gitlab/gitlab-debian.conf
|
||||||
export $(cat /etc/gitlab/gitlab-debian.conf)
|
export DB RAILS_ENV
|
||||||
|
|
||||||
cd /usr/share/gitlab
|
cd /usr/share/gitlab
|
||||||
|
|
||||||
# Check if the db is already present
|
# Check if the db is already present
|
||||||
|
@ -25,4 +26,4 @@ fi
|
||||||
chmod 0700 ${gitlab_data_dir}/.gitlab_shell_secret
|
chmod 0700 ${gitlab_data_dir}/.gitlab_shell_secret
|
||||||
|
|
||||||
echo "Precompiling assets..."
|
echo "Precompiling assets..."
|
||||||
su ${gitlab_user} -s /bin/sh -c 'bundle exec rake tmp:cache:clear assets:precompile RAILS_ENV=production'
|
su ${gitlab_user} -s /bin/sh -c 'bundle exec rake tmp:cache:clear assets:precompile'
|
||||||
|
|
3
debian/tests/spec
vendored
3
debian/tests/spec
vendored
|
@ -18,11 +18,12 @@ set -ex
|
||||||
cd /usr/share/gitlab
|
cd /usr/share/gitlab
|
||||||
su gitlab -c 'truncate -s 0 Gemfile.lock'
|
su gitlab -c 'truncate -s 0 Gemfile.lock'
|
||||||
|
|
||||||
export $(cat /etc/gitlab/gitlab-debian.conf)
|
. /etc/gitlab/gitlab-debian.conf
|
||||||
export INCLUDE_TEST_DEPENDS="true"
|
export INCLUDE_TEST_DEPENDS="true"
|
||||||
su gitlab -c "bundle install --local"
|
su gitlab -c "bundle install --local"
|
||||||
su gitlab -c "mkdir -p tmp/tests/gitlab-shell"
|
su gitlab -c "mkdir -p tmp/tests/gitlab-shell"
|
||||||
export RAILS_ENV=test
|
export RAILS_ENV=test
|
||||||
|
export DB=postgres
|
||||||
export dbname=gitlab_test
|
export dbname=gitlab_test
|
||||||
su postgres -c "createdb $dbname"
|
su postgres -c "createdb $dbname"
|
||||||
# enable the pg_trgm extension
|
# enable the pg_trgm extension
|
||||||
|
|
Loading…
Reference in a new issue