Skip to content

Instantly share code, notes, and snippets.

@slottermoser
Last active January 2, 2016 18:43
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slottermoser/5402483 to your computer and use it in GitHub Desktop.
Save slottermoser/5402483 to your computer and use it in GitHub Desktop.
Everything I needed to do to get the GitLab Vagrant VM up and running.

After running vagrant up and logging into the box with vagrant ssh

Setup gitlab.yml

You'll want to edit /vagrant/gitlabhq/config/gitlab.yml to your dedired settings for your dev environment, as well as change the default user to the vagrant user as the default git user does not exist:

    # Uncomment and customize if you can't use the default user to run GitLab (default: 'git')
    user: vagrant

Setup correct paths

Add a symlink to gitlab-shell in your home directory:

ln -s /vagrant/gitlab-shell ~/

Some paths need to be corrected. Here's my diff:

diff --git a/site-cookbooks/gitlab/templates/default/gitlab.yml.erb b/site-cookbooks/gitlab/templates/default/gitlab.yml
index 6e757f0..b42b41b 100644
--- a/site-cookbooks/gitlab/templates/default/gitlab.yml.erb
+++ b/site-cookbooks/gitlab/templates/default/gitlab.yml.erb
@@ -123,7 +123,7 @@ production: &base
   ## GitLab Shell settings
   gitlab_shell:
     # REPOS_PATH MUST NOT BE A SYMLINK!!!
-    repos_path: /vagrant/repositories/
+    repos_path: /vagrant/gitlabhq/tmp/repositories/
     hooks_path: /vagrant/gitlab-shell/hooks/
 
     # Git over HTTP
diff --git a/site-cookbooks/gitlab/templates/default/gitlab_shell.yml.erb b/site-cookbooks/gitlab/templates/default/gitl
index 06eb1c1..6f4ea80 100644
--- a/site-cookbooks/gitlab/templates/default/gitlab_shell.yml.erb
+++ b/site-cookbooks/gitlab/templates/default/gitlab_shell.yml.erb
@@ -5,7 +5,7 @@ user: vagrant
 gitlab_url: "http://localhost/"
 
 # Repositories path
-repos_path: "/home/vagrant"
+repos_path: "/vagrant/gitlabhq/tmp/repositories/"
 
 # File used as authorized_keys for gitlab user
 auth_file: "/home/vagrant/.ssh/authorized_keys"

Setup SSH

Out of the box, there is something messed up with the rvm configuration. If you try to push a repo, you'll get the following error:

$ git push -u origin master
/usr/bin/env: ruby: No such file or directory
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

The correction for now is to make sure rvm gets loaded by editing the .bashrc file and moving the line loading rvm above the line that returns from .bashrc file when in a non-interactive mode:

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

...(rest of file)

Get things running

Now you need to get sidekiq and gitlab running!

cd /vagrant/gitlabhq
bundle exec rake sidekiq:start
rvmsudo rails s -p 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment