add dpkg trigger to recreate Gemfile.lock
This commit is contained in:
parent
370503b349
commit
daece03c7a
3 changed files with 51 additions and 20 deletions
2
debian/adduser.sh
vendored
2
debian/adduser.sh
vendored
|
@ -12,3 +12,5 @@ adduser --system --home /var/lib/${gitlab_user} --gecos "${gitlab_user} user" --
|
||||||
--quiet --disabled-password --group ${gitlab_user} || {
|
--quiet --disabled-password --group ${gitlab_user} || {
|
||||||
echo "Proceeding with existing ${gitlab_user} user..."
|
echo "Proceeding with existing ${gitlab_user} user..."
|
||||||
}
|
}
|
||||||
|
echo "Making ${gitlab_user} owner of /var/lib/${gitlab_user}..."
|
||||||
|
chown -R ${gitlab_user} /var/lib/${gitlab_user}
|
||||||
|
|
1
debian/gitlab.triggers
vendored
Normal file
1
debian/gitlab.triggers
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
interest-noawait /usr/lib/ruby/vendor_ruby
|
42
debian/postinst
vendored
42
debian/postinst
vendored
|
@ -7,6 +7,9 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# Show debconf questions
|
||||||
|
. /usr/share/debconf/confmodule
|
||||||
|
|
||||||
# summary of how this script can be called:
|
# summary of how this script can be called:
|
||||||
# * <postinst> `configure' <most-recently-configured-version>
|
# * <postinst> `configure' <most-recently-configured-version>
|
||||||
# * <old-postinst> `abort-upgrade' <new version>
|
# * <old-postinst> `abort-upgrade' <new version>
|
||||||
|
@ -25,14 +28,11 @@ set -e
|
||||||
# installation fails and the `postinst' is called with `abort-upgrade',
|
# installation fails and the `postinst' is called with `abort-upgrade',
|
||||||
# `abort-remove' or `abort-deconfigure'.
|
# `abort-remove' or `abort-deconfigure'.
|
||||||
|
|
||||||
|
#######################################################################
|
||||||
case "$1" in
|
|
||||||
configure)
|
|
||||||
# Show debconf questions
|
|
||||||
. /usr/share/debconf/confmodule
|
|
||||||
|
|
||||||
# Read and export debian specific configuration
|
# Read and export debian specific configuration
|
||||||
# Only exported variables will be passed on to gitlab app
|
# Only exported variables will be passed on to gitlab app
|
||||||
|
#######################################################################
|
||||||
|
|
||||||
# Bootstrap config file - first try
|
# Bootstrap config file - first try
|
||||||
gitlab_debian_conf_example=/usr/share/doc/gitlab/gitlab-debian.conf.example
|
gitlab_debian_conf_example=/usr/share/doc/gitlab/gitlab-debian.conf.example
|
||||||
export $(cat ${gitlab_debian_conf_example})
|
export $(cat ${gitlab_debian_conf_example})
|
||||||
|
@ -47,6 +47,32 @@ case "$1" in
|
||||||
# Create gitlab user
|
# Create gitlab user
|
||||||
. /usr/lib/gitlab/scripts/adduser.sh
|
. /usr/lib/gitlab/scripts/adduser.sh
|
||||||
|
|
||||||
|
#######################################################################
|
||||||
|
# update Gemfile.lock, always
|
||||||
|
#######################################################################
|
||||||
|
su ${gitlab_user} -s /bin/sh -c 'truncate -s 0 ${gitlab_data_dir}/Gemfile.lock'
|
||||||
|
cd ${gitlab_app_root}
|
||||||
|
if ! su ${gitlab_user} -s /bin/sh -c 'bundle --local --quiet'; then
|
||||||
|
if [ "$1" = "triggered" ]; then
|
||||||
|
# probably triggered in the middle of an system upgrade; ignore failure
|
||||||
|
# but abort here
|
||||||
|
echo "#########################################################################"
|
||||||
|
echo "# Failed to detect gitlab dependencies; if you are in the middle of an #"
|
||||||
|
echo "# upgrade, this is probably fine, there will be another attempt later. #"
|
||||||
|
echo "# #"
|
||||||
|
echo "# If you are NOT in the middle of an upgrade, there is probably a real #"
|
||||||
|
echo "# issue. Please report a bug. #"
|
||||||
|
echo "#########################################################################"
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
# something is really broken
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
cd - >/dev/null
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
configure)
|
||||||
gitlab_builds_log=${gitlab_log_dir}/builds
|
gitlab_builds_log=${gitlab_log_dir}/builds
|
||||||
gitlab_repo_path=${gitlab_data_dir}/repositories
|
gitlab_repo_path=${gitlab_data_dir}/repositories
|
||||||
gitlab_uploads_path=${gitlab_data_dir}/public/uploads
|
gitlab_uploads_path=${gitlab_data_dir}/public/uploads
|
||||||
|
@ -222,8 +248,10 @@ EOF
|
||||||
|
|
||||||
echo "Running final rake tasks and tweaks..."
|
echo "Running final rake tasks and tweaks..."
|
||||||
. /usr/lib/gitlab/scripts/rake-tasks.sh
|
. /usr/lib/gitlab/scripts/rake-tasks.sh
|
||||||
|
;;
|
||||||
|
|
||||||
|
triggered)
|
||||||
|
# Already handled
|
||||||
;;
|
;;
|
||||||
|
|
||||||
abort-upgrade|abort-remove|abort-deconfigure)
|
abort-upgrade|abort-remove|abort-deconfigure)
|
||||||
|
|
Loading…
Reference in a new issue