Git Product home page Git Product logo

gitlab-vagrant-vm's Introduction

Gitlab-Vagrant-VM

Description

Setup a dev environment for Gitlab.

The final product contain all databases set up, working tests and all gems installed.

Requirements

  • VirtualBox
  • Vagrant
  • the NFS packages. Already there if you are using Mac OS, and not necessary if you are using Windows. On Linux:
$ sudo apt-get install nfs-kernel-server nfs-common portmap

On OS X you can also choose to use the (commercial) Vagrant VMware Fusion plugin instead of VirtualBox.

  • some patience :)

Installation

Clone the repository:

$ git clone https://github.com/gitlabhq/gitlab-vagrant-vm
$ cd gitlab-vagrant-vm

And install gems and chef's necessary packages:

$ bundle install
$ bundle exec librarian-chef install

Finally, you should be able to use:

$ vagrant up

By default the VM uses 1GB of memory and 1 CPU core. If you want to use more memory or cores you can use the GITLAB_VAGRANT_MEMORY and GITLAB_VAGRANT_CORES environment variables:

GITLAB_VAGRANT_MEMORY=1536 GITLAB_VAGRANT_CORES=2 vagrant up

Note: You can't use a vagrant project on an encrypted partition (ie. it won't work if your home directory is encrypted).

You'll be asked for your password to set up NFS shares.

Once everything is done you can log into the virtual machine to run tests:

$ vagrant ssh
$ cd /vagrant/gitlabhq/
$ bundle exec rake gitlab:test

You should also configure your own remote since by default it's going to grab gitlab's master branch.

$ git remote add mine git://github.com/me/gitlabhq.git
$ # or if you prefer set up your origin as your own repository
$ git remote set-url origin git://github.com/me/gitlabhq.git

Virtual Machine Management

When done just log out with ^D and suspend the virtual machine

$ vagrant suspend

then, resume to hack again

$ vagrant resume

Run

$ vagrant halt

to shutdown the virtual machine, and

$ vagrant up

to boot it again.

You can find out the state of a virtual machine anytime by invoking

$ vagrant status

Finally, to completely wipe the virtual machine from the disk destroying all its contents:

$ vagrant destroy # DANGER: all is gone

Information

  • Virtual Machine IP: 192.168.3.14
  • User/password: vagrant/vagrant
  • MySQL user/password: vagrant/Vagrant
  • MySQL root password: nonrandompasswordsaregreattoo
  • Xvfb is used as a service and it should be already running, but in case you need to restart it manually:
$ sudo /etc/init.d/xvfb stop
$ sudo /etc/init.d/xvfb start
  • Install another Ruby: rbenv install 1.9.3-p448
  • Switch to a different Ruby: rbenv global 1.9.3-p448

Updating

The gitlabhq version is not updated when you rebuild your virtual machine with the following command:

$ vagrant destroy && vagrant up

You must update it yourself by going to the gitlabhq subdirectory in the gitlab-vagrant-vm repo and pulling the latest changes:

$ cd gitlabhq && git pull --ff origin master

A bit of background on why this is needed. When you run 'vagrant up' there is a checkout action in the recipe that points to the gitlabhq repo. You won't see any difference when running 'git status' in the gitlab-vagrant-vm repo because gitlabhq/ is in the .gitignore. You can update the gitlabhq repo yourself or remove the gitlabhq directory so the repo is checked out again.

gitlab-vagrant-vm's People

Contributors

jacobvosmaer avatar dzaporozhets avatar saitowu avatar kouno avatar dosire avatar senny avatar brodock avatar cabello avatar jirutka avatar maxlazio avatar pierrepaul avatar rbieber avatar justahero avatar vsizov avatar kenxengineering avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.