Skip to content

Launch-with-1-Click/cookbook-gitlab

 
 

Repository files navigation

GitLab Cookbook

Chef to install The GitLab.

  • GitLab: 6.3.0
  • GitLab Shell: 1.7.9
  • Ruby: 2.0.0
  • Redis: 2.6.13
  • Git: 1.7.12
  • Nginx: 1.1.19
  • PostgreSQL: 9.1.9
  • MySQL: 5.5.31

Requirements

Vagrant Plugin

Platform:

  • Ubuntu (12.04, 12.10)
  • CentOS (6.4)

Attributes

  • Package
  • User
  • GitLab shell
  • GitLab shell config
  • GitLab hq
  • GitLab hq config
  • Gems
  • Git

Installation

Vagrant

VirtualBox

$ gem install berkshelf
$ vagrant plugin install vagrant-berkshelf
$ vagrant plugin install vagrant-omnibus
$ git clone git://github.com/ogom/cookbook-gitlab ./gitlab
$ cd ./gitlab/
$ vagrant up

Amazon Web Services

Create instance.

$ gem install berkshelf
$ vagrant plugin install vagrant-berkshelf
$ vagrant plugin install vagrant-omnibus
$ vagrant plugin install vagrant-aws
$ vagrant box add dummy https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box
$ git clone git://github.com/ogom/cookbook-gitlab ./gitlab
$ cd ./gitlab/
$ cp ./example/Vagrantfile_aws ./Vagrantfile
$ vagrant up --provider=aws

HostName setting.

$ vagrant ssh-config | awk '/HostName/ {print $2}'
$ editor ./Vagrantfile
$ vagrant provision

knife-solo

$ gem install berkshelf
$ gem install knife-solo
$ knife configure
$ knife solo init ./chef-repo
$ cd ./chef-repo/
$ echo 'cookbook "gitlab", github: "ogom/cookbook-gitlab"' >> ./Berksfile
$ berks install --path ./cookbooks
$ knife solo prepare [email protected] -p 2222 -i ~/.vagrant.d/insecure_private_key
$ editor ./nodes/127.0.0.1.json
$ knife solo cook [email protected] -p 2222 -i ~/.vagrant.d/insecure_private_key --no-chef-check

Usage

Example of node config.

{
  "postfix": {
    "mail_type": "client",
    "myhostname": "mail.example.com",
    "mydomain": "example.com",
    "myorigin": "mail.example.com",
    "smtp_use_tls": "no"
  },
  "postgresql": {
    "password": {
      "postgres": "psqlpass"
    }
  },
  "mysql": {
    "server_root_password": "rootpass",
    "server_repl_password": "replpass",
    "server_debian_password": "debianpass"
  },
  "gitlab": {
    "host": "example.com",
    "url": "http://example.com/",
    "email_from": "[email protected]",
    "support_email": "[email protected]",
    "database_adapter": "postgresql",
    "database_password": "datapass",
    "env": "production"
  },
  "run_list":[
    "postfix",
    "gitlab::initial",
    "gitlab::install"
  ]
}

Database use mysql.

Set mysql to database_adapter.

{
...
  "gitlab": {
    "database_adapter": "mysql"
  }
}

GitLab Update

Add gitlab::update to run_list.

{
...
  "run_list":[
    "gitlab::update",
    "gitlab::initial",
    "gitlab::install"
  ]
}

Done!

http://localhost:8080/ or your server for your first GitLab login.

Links

License

  • MIT