gitlab: removed the "app:db:initialize" command, "app:rake gitlab:setup" is now used for initialization

This commit is contained in:
Sameer Naik 2014-02-24 22:40:23 +05:30
parent 62216f3224
commit d7ff2afd66
2 changed files with 9 additions and 18 deletions

View File

@ -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 \

View File

@ -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 <task> - Execute rake task."
echo " app:db:initialize - Initialize the database."
echo " app:rake <task> - 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
;;