gitlab: added initialize command

This commit is contained in:
Sameer Naik 2013-11-24 16:58:38 +05:30
parent f06f9acdc2
commit b8ba8ad5ac

View File

@ -125,11 +125,16 @@ chown -R git:git /home/git/.ssh
cd /home/git/gitlab/
db_initialize () {
echo "Initializing database..."
sudo -u git -H force=yes bundle exec rake gitlab:setup RAILS_ENV=production
}
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
db_initialize
fi
# start the gitlab application
@ -150,6 +155,7 @@ gitlab_start () {
gitlab_help () {
echo "Available options:"
echo " start - Starts the gitlab server (default)"
echo " initialize - Initialize the database."
echo " help - Displays the help"
}
@ -157,6 +163,9 @@ case "$1" in
start)
gitlab_start
;;
initialize)
db_initialize
;;
help|*)
gitlab_help
;;