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 "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 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