File gitlab-ce-update of Package gitlab-ce
#!/bin/sh
# if [ "x$(id -un)" != "xdiscourse" ] ; then
# echo "Please run this script as discourse user" 1>&2
# exit 1
# fi
set -e
export RAILS_ENV="${RAILS_ENV:=production}"
export NODE_ENV="${NODE_ENV:=production}"
export LC_ALL="en_US.UTF-8"
export LANG="en_US.UTF-8"
echo "Hoping into the basedir within env $RAILS_ENV"
cd /srv/www/vhosts/gitlab-ce/
if [ ! -e tmp/rebuild.txt ] ; then
echo "Nothing to do for gitlab-ce-update. Exiting"
exit 0
fi
sha256sum Gemfile.lock Gemfile
echo "Cleaning up bootsnap-load-path-cache"
if [ -e tmp/cache/bootsnap-load-path-cache ] ; then
rm tmp/cache/bootsnap-load-path-cache
fi
echo "Running rake"
# gitlab:assets:clean \
# assets:precompile \
# webpack:compile \
# gitlab:assets:fix_urls \
/usr/bin/bundle.@RUBY_SUFFIX@ exec /usr/bin/rake.@RUBY_SUFFIX@ \
db:migrate \
cache:clear
echo "Fixing permissions"
chown -R gitlab:gitlab tmp/ log/ public/uploads/
chown -R root:gitlab .gitlab*secret config/
chmod u=rw,g=r,o= .gitlab*secret
chmod -R u=rwX,g=rX,o+X tmp/{cache,feature_flags,pids,prometheus_multiproc_dir,sessions}
chmod -R u=rwX,g=rX,o= log/ config/
#chown -R root:gitlab public/assets/
chmod -R go+rX public/
echo "Cleanup old sprocket manifest files "
find public/assets/ -name .sprockets-man\* -not -name SPROCKETS_FILE -print -delete
echo "Trigger tmp/restart.txt"
touch tmp/restart.txt
echo "Finalize rebuild"
rm -f tmp/rebuild.txt