gitlab: gitlab script can now be passed commands to perform specific tasks. Defaults to start.

This commit is contained in:
Sameer Naik 2013-11-24 16:53:05 +05:30
parent fa20322c0a
commit f06f9acdc2
2 changed files with 36 additions and 15 deletions

View File

@ -33,4 +33,5 @@ RUN chmod 700 /root/.ssh && chmod 600 /root/.ssh/authorized_keys && chown root:r
EXPOSE 22
EXPOSE 80
CMD ["/gitlab/gitlab"]
ENTRYPOINT ["/gitlab/gitlab"]
CMD ["start"]

View File

@ -125,21 +125,41 @@ chown -R git:git /home/git/.ssh
cd /home/git/gitlab/
# reset the database if the --db-init switch was given.
if [ "$DB_INIT" == "yes" ]; then
sudo -u git -H force=yes bundle exec rake gitlab:setup RAILS_ENV=production
fi
gitlab_start () {
echo "Starting gitlab server..."
# reset the database if the --db-init switch was given.
if [ "$DB_INIT" == "yes" ]; then
sudo -u git -H force=yes bundle exec rake gitlab:setup RAILS_ENV=production
fi
# start the gitlab application
# sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
/etc/init.d/gitlab start
# start the gitlab application
# sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
/etc/init.d/gitlab start
# create satellite directories
sudo -u git -H bundle exec rake gitlab:satellites:create RAILS_ENV=production
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
# create satellite directories
sudo -u git -H bundle exec rake gitlab:satellites:create RAILS_ENV=production
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
# kickstart the rails application
wget "http://localhost" -O /dev/null
# kickstart the rails application
wget "http://localhost" -O /dev/null
# watch the access logs
tail -F /var/log/nginx/gitlab_access.log
# watch the access logs
tail -F /var/log/nginx/gitlab_access.log
}
gitlab_help () {
echo "Available options:"
echo " start - Starts the gitlab server (default)"
echo " help - Displays the help"
}
case "$1" in
start)
gitlab_start
;;
help|*)
gitlab_help
;;
esac
exit 0