Permalink
Browse files

added vagrantfile and chef

  • Loading branch information...
1 parent e34f55c commit a68c0f69bf429de0d8c63d01ff72afa468607706 @dpmcnevin committed Dec 4, 2011
View
@@ -0,0 +1,3 @@
+[submodule "gitlab"]
+ path = gitlab
+ url = https://github.com/gitlabhq/gitlabhq.git
View
@@ -0,0 +1,86 @@
+Vagrant::Config.run do |config|
+ # All Vagrant configuration is done here. The most common configuration
+ # options are documented and commented below. For a complete reference,
+ # please see the online documentation at vagrantup.com.
+
+ # Every Vagrant virtual environment requires a box to build off of.
+ config.vm.box = "lucid32"
+
+ # The url from where the 'config.vm.box' box will be fetched if it
+ # doesn't already exist on the user's system.
+ # config.vm.box_url = "http://domain.com/path/to/above.box"
+
+ # Boot with a GUI so you can see the screen. (Default is headless)
+ # config.vm.boot_mode = :gui
+
+ # Assign this VM to a host only network IP, allowing you to access it
+ # via the IP.
+ config.vm.network "33.33.33.20"
+
+ # Forward a port from the guest to the host, which allows for outside
+ # computers to access the VM, whereas host only networking does not.
+ # config.vm.forward_port "http", 80, 8080
+
+ # Share an additional folder to the guest VM. The first argument is
+ # an identifier, the second is the path on the guest to mount the
+ # folder, and the third is the path on the host to the actual folder.
+ # config.vm.share_folder "v-data", "/vagrant_data", "../data"
+
+ # Enable provisioning with Puppet stand alone. Puppet manifests
+ # are contained in a directory path relative to this Vagrantfile.
+ # You will need to create the manifests directory and a manifest in
+ # the file base.pp in the manifests_path directory.
+ #
+ # An example Puppet manifest to provision the message of the day:
+ #
+ # # group { "puppet":
+ # # ensure => "present",
+ # # }
+ # #
+ # # File { owner => 0, group => 0, mode => 0644 }
+ # #
+ # # file { '/etc/motd':
+ # # content => "Welcome to your Vagrant-built virtual machine!
+ # # Managed by Puppet.\n"
+ # # }
+ #
+ # config.vm.provision :puppet do |puppet|
+ # puppet.manifests_path = "manifests"
+ # puppet.manifest_file = "base.pp"
+ # end
+
+ # Enable provisioning with chef solo, specifying a cookbooks path (relative
+ # to this Vagrantfile), and adding some recipes and/or roles.
+ #
+ config.vm.provision :chef_solo do |chef|
+ chef.cookbooks_path = "chef/cookbooks"
+ chef.roles_path = "chef/roles"
+ chef.add_role "gitlab"
+
+ # You may also specify custom JSON attributes:
+ chef.json = { :mysql_password => "foo" }
+ end
+
+ # Enable provisioning with chef server, specifying the chef server URL,
+ # and the path to the validation key (relative to this Vagrantfile).
+ #
+ # The Opscode Platform uses HTTPS. Substitute your organization for
+ # ORGNAME in the URL and validation key.
+ #
+ # If you have your own Chef Server, use the appropriate URL, which may be
+ # HTTP instead of HTTPS depending on your configuration. Also change the
+ # validation key to validation.pem.
+ #
+ # config.vm.provision :chef_client do |chef|
+ # chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
+ # chef.validation_key_path = "ORGNAME-validator.pem"
+ # end
+ #
+ # If you're using the Opscode platform, your validator client is
+ # ORGNAME-validator, replacing ORGNAME with your organization name.
+ #
+ # IF you have your own Chef Server, the default validation client name is
+ # chef-validator, unless you changed the configuration.
+ #
+ # chef.validation_client_name = "ORGNAME-validator"
+end
@@ -0,0 +1,33 @@
+execute "update apt" do
+ command "apt-get update"
+end
+
+packages = %w{
+ git-core
+ curl
+ gcc
+ g++
+ libxml2-dev
+ libxslt1-dev
+ sqlite3
+ libsqlite3-dev
+ libcurl4-openssl-dev
+ libreadline5-dev
+ libc6-dev
+ libssl-dev
+ libmysql++-dev
+ make
+ build-essential
+ zlib1g-dev
+ python-setuptools
+ python-dev
+ ack-grep
+
+ htop
+ lsof
+ tree
+}
+
+packages.each do |pkg|
+ package pkg
+end
@@ -0,0 +1,14 @@
+rvm_shell "run bundler" do
+ # ruby_string "1.9.2"
+ # user "git"
+ # group "git"
+ cwd "/vagrant"
+ # code %{rake RAILS_ENV=production db:migrate}
+ code %{bundle}
+end
+
+rvm_shell "set up database" do
+ cwd "/vagrant"
+ code %{RAILS_ENV=production rake db:setup; RAILS_ENV=production rake db:seed_fu}
+ creates "/vagrant/db/production.sqlite3"
+end
@@ -0,0 +1,42 @@
+package "gitosis"
+
+user "git" do
+ comment "Gitosis user"
+ system true
+ home "/home/git"
+ shell "/bin/sh"
+end
+
+group "git" do
+ members ["git", "vagrant"]
+end
+
+directory "/home/git" do
+ owner "git"
+ group "git"
+ mode "0750"
+ action :create
+end
+
+directory "/home/git/.ssh" do
+ owner "git"
+ group "git"
+ mode "0700"
+ action :create
+end
+
+username = "vagrant"
+execute "generate ssh skys for #{username}." do
+ user username
+ creates "/home/#{username}/.ssh/id_rsa.pub"
+ command "ssh-keygen -t rsa -q -f /home/#{username}/.ssh/id_rsa -P \"\""
+end
+
+bash "install gitosis" do
+ cwd "/home/git"
+ code <<-EOH
+ sudo -H -u git gitosis-init < ~#{username}/.ssh/id_rsa.pub
+ sudo chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update
+ EOH
+ not_if "test -f /home/git/repositories/gitosis-admin.git/hooks/post-update"
+end
@@ -0,0 +1,3 @@
+easy_install_package "pygments" do
+ action :install
+end
Submodule rvm added at afe8b2
@@ -0,0 +1 @@
+rvm_gem "chef"
View
@@ -0,0 +1,12 @@
+name "gitlab"
+description "GitLab Web App"
+
+run_list(
+ "recipe[base_packages]",
+ "recipe[rvm::system]",
+ "recipe[rvm::vagrant]",
+ "recipe[vagrant]",
+ "recipe[pygments]",
+ "recipe[gitosis]",
+ "recipe[gitlab]"
+)
1 gitlab
Submodule gitlab added at da424d

0 comments on commit a68c0f6

Please sign in to comment.