From d7ff2afd66221cfbfbe873b7518fbc46486125a5 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Mon, 24 Feb 2014 22:40:23 +0530 Subject: [PATCH] gitlab: removed the "app:db:initialize" command, "app:rake gitlab:setup" is now used for initialization --- README.md | 14 +++++++------- resources/gitlab | 13 ++----------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 0444b503..be7599e2 100644 --- a/README.md +++ b/README.md @@ -157,20 +157,20 @@ CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'%.%.%.%'; ``` -To make sure the database is initialized start the container with **app:db:initialize** option. +To make sure the database is initialized start the container with **app:rake gitlab:setup** option. **NOTE: This should be done only for the first run**. *Assuming that the mysql server host is 192.168.1.100* ```bash -docker run -d \ +docker run -i -t \ -e "DB_HOST=192.168.1.100" -e "DB_NAME=gitlabhq_production" -e "DB_USER=gitlab" -e "DB_PASS=password" \ -v /opt/gitlab/data:/home/git/data \ - sameersbn/gitlab app:db:initialize + sameersbn/gitlab app:rake gitlab:setup ``` -This will initialize the gitlab database. Now that the database is initialized, start the container without the initialize command. +This will initialize the gitlab database. Now that the database is initialized, start the container normally. ```bash docker run -d \ @@ -189,7 +189,7 @@ createuser gitlab createdb -O gitlab gitlabhq_production ``` -To make sure the database is initialized start the container with **app:db:initialize** option. +To make sure the database is initialized start the container with **app:rake gitlab:setup** option. **NOTE: This should be done only for the first run**. @@ -199,10 +199,10 @@ To make sure the database is initialized start the container with **app:db:initi docker run -d \ -e "DB_TYPE=postgres" -e "DB_HOST=192.168.1.100" -e "DB_NAME=gitlabhq_production" -e "DB_USER=gitlab" -e "DB_PASS=password" \ -v /opt/gitlab/data:/home/git/data \ - sameersbn/gitlab app:db:initialize + sameersbn/gitlab app:rake gitlab:setup ``` -This will initialize the gitlab database. Now that the database is initialized, start the container without the initialize command. +This will initialize the gitlab database. Now that the database is initialized, start the container normally. ```bash docker run -d \ diff --git a/resources/gitlab b/resources/gitlab index fb71c4a5..7f9f9f3b 100755 --- a/resources/gitlab +++ b/resources/gitlab @@ -225,16 +225,11 @@ chown -R git:git /home/git/data/.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 - db_initialize + sudo -u git -H force=yes bundle exec rake gitlab:setup RAILS_ENV=production fi sudo -u git -H bundle exec rake assets:clean RAILS_ENV=production @@ -292,8 +287,7 @@ gitlab_rake () { gitlab_help () { echo "Available options:" echo " app:start - Starts the gitlab server (default)" - echo " app:rake - Execute rake task." - echo " app:db:initialize - Initialize the database." + echo " app:rake - Execute a rake task." echo " app:help - Displays the help" echo " [command] - Execute the specified linux command eg. bash." } @@ -302,9 +296,6 @@ case "$1" in app:start) gitlab_start ;; - app:db:initialize) - db_initialize - ;; app:rake) gitlab_rake $2 ;;