diff --git a/README.md b/README.md index 8a416392..0b0d3717 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ - [Automated Backups](#automated-backups) - [Amazon Web Services (AWS) Remote Backups](#amazon-web-services-aws-remote-backups) - [Rake Tasks](#rake-tasks) + - [Import Repositories](#import-repositories) - [Upgrading](#upgrading) - [Shell Access](#shell-access) - [References](#references) @@ -1019,6 +1020,26 @@ For a complete list of available rake tasks please refer https://github.com/gitl *P.S. Please avoid running the rake tasks for backup and restore operations on a running gitlab instance.* +## Import Repositories + +By default the `docker-compose.yml` places GitLab repos in `/srv/docker/gitlab/gitlab/repositories` on the host, they are in `/home/git/data` inside the container. +Copy all the **bare** repos (by rsync or scp, rsync is faster) to that folder on the host so that they are visible inside the container. +Before you run the next command, make sure the DB container (`postgresql` by default) and the `redis` container are running. The easiest way is to start all the containers with `docker-compose up -d` and then stop the GitLab container. + +To import all the repositories into GitLab execute this `rake` command in a terminal. +``` +docker run --name gitlab -it --rm \ + --link redis:NAME_OF_REDIS_CONTAINER \ + --link postgresql:NAME_OF_POSTGRES_CONTAINER \ + --e "GITLAB_SECRETS_DB_KEY_BASE=dslkjfskjdfwlekjflskdjflskdjfalskdhflaksdjagjdl" + -v "/srv/docker/gitlab/gitlab:/home/git/data" + [OTHER OPTIONS] \ + sameersbn/gitlab:8.4.3 app:rake gitlab:import:repos +``` +Watch the logs and your repos should be available into your new gitlab container. +Most commands can be executed with `rake`. +See [Rake Tasks](#rake-tasks) + ## Upgrading GitLabHQ releases new versions on the 22nd of every month, bugfix releases immediately follow. I update this project almost immediately when a release is made (at least it has been the case so far). If you are using the image in production environments I recommend that you delay updates by a couple of days after the gitlab release, allowing some time for the dust to settle down.