Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Commit

Permalink
Use librarian-puppet and update to latest Phabicator
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaogaozi committed Jun 8, 2014
1 parent e70d455 commit 5cd6c5c
Show file tree
Hide file tree
Showing 11 changed files with 96 additions and 47 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -4,7 +4,10 @@ libphutil/
phabricator/
modules/*
!modules/nginx/
!modules/phabricator/
!modules/php/
.librarian/
.tmp/

### /Users/xiaogaozi/.gitignore-boilerplates/Global/vim.gitignore

Expand Down
5 changes: 5 additions & 0 deletions Puppetfile
@@ -0,0 +1,5 @@
forge "http://forge.puppetlabs.com"

mod "puppetlabs/apt"
mod "puppetlabs/inifile"
mod "puppetlabs/mysql"
15 changes: 15 additions & 0 deletions Puppetfile.lock
@@ -0,0 +1,15 @@
FORGE
remote: http://forge.puppetlabs.com
specs:
puppetlabs/apt (1.5.0)
puppetlabs/stdlib (>= 2.2.1)
puppetlabs/inifile (1.1.0)
puppetlabs/mysql (2.2.3)
puppetlabs/stdlib (>= 3.2.0)
puppetlabs/stdlib (4.2.2)

DEPENDENCIES
puppetlabs/apt (>= 0)
puppetlabs/inifile (>= 0)
puppetlabs/mysql (>= 0)

10 changes: 7 additions & 3 deletions README.md
Expand Up @@ -2,12 +2,16 @@

Phabricator development box using Vagrant

## Quickstart ##
## Quick Start ##

```bash
$ git clone https://github.com/xiaogaozi/vagrant-phabricator.git
$ git clone git@github.com:xiaogaozi/vagrant-phabricator.git
$ cd vagrant-phabricator
$ git clone git@github.com:phacility/libphutil.git
$ git clone git@github.com:phacility/arcanist.git
$ git clone git@github.com:phacility/phabricator.git
$ librarian-puppet install
$ vagrant up
```

Phabricator is now running at http://192.168.33.10/
Phabricator is now running at [http://192.168.33.10](http://192.168.33.10), you could also access through [http://ph.dev](http://ph.dev) if you edit your `/etc/hosts` file.
26 changes: 21 additions & 5 deletions Vagrantfile
Expand Up @@ -7,11 +7,11 @@ Vagrant.configure("2") do |config|
# please see the online documentation at vagrantup.com.

# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "debian-607-x64-vbox4210"
config.vm.box = "debian-73-x64-virtualbox-puppet"

# 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://puppet-vagrant-boxes.puppetlabs.com/debian-607-x64-vbox4210.box"
config.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/debian-73-x64-virtualbox-puppet.box"

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
Expand Down Expand Up @@ -47,9 +47,25 @@ Vagrant.configure("2") do |config|
vb.customize ["modifyvm", :id, "--memory", "512"]
end

config.vm.provision "shell", path: "bootstrap.sh"

config.vm.provision :puppet do |puppet|
# 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, run: "always" do |puppet|
puppet.module_path = "modules"
end
end
26 changes: 0 additions & 26 deletions bootstrap.sh

This file was deleted.

20 changes: 10 additions & 10 deletions manifests/default.pp
Expand Up @@ -10,50 +10,50 @@
repos => 'main contrib non-free',
include_src => false
}

apt::source { 'debian_updates':
location => 'http://http.debian.net/debian/',
release => "${::lsbdistcodename}-proposed-updates",
repos => 'main contrib non-free',
include_src => false
}

apt::source { 'debian_security':
location => 'http://security.debian.org/',
release => "${::lsbdistcodename}/updates",
repos => 'main contrib non-free',
include_src => false
}

apt::source { 'puppetlabs':
location => 'http://apt.puppetlabs.com',
repos => 'main',
key => '4BD6EC30',
key_server => 'pgp.mit.edu',
}

apt::source { 'dotdeb':
location => 'http://packages.dotdeb.org',
repos => 'all',
key => '89DF5277',
key_source => 'http://www.dotdeb.org/dotdeb.gpg'
}

Apt::Source['dotdeb'] -> Class['nginx']
Apt::Source['dotdeb'] -> Class['php']
# Update before install any packages
exec { 'apt-update':
command => '/usr/bin/apt-get update'
}
Apt::Source <| |> -> Exec['apt-update'] -> Package <| |>

# Install and configure nginx
include nginx
nginx::server { 'ph.dev':
root => '/vagrant/phabricator/webroot'
}

# And PHP
include php

# And MySQL
class { 'mysql::server':
root_password => 'root',
}

file { '/etc/profile.d/ph.sh':
ensure => present,
content => 'export PHABRICATOR_ENV=custom/myconfig'
}
# And Phabricator
include phabricator
3 changes: 0 additions & 3 deletions modules/nginx/templates/ph.conf.erb
Expand Up @@ -18,9 +18,6 @@ server {
fastcgi_pass localhost:9000;
fastcgi_index index.php;

#custom environment variable
fastcgi_param PHABRICATOR_ENV "custom/myconfig";

#required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;

Expand Down
12 changes: 12 additions & 0 deletions modules/phabricator/files/local.json
@@ -0,0 +1,12 @@
{
"environment.append-paths" : [
"\/bin",
"\/usr\/bin",
"\/usr\/local\/bin"
],
"repository.default-local-path" : "\/home\/vagrant",
"mysql.pass" : "root",
"mysql.user" : "root",
"mysql.host" : "127.0.0.1",
"phabricator.base-uri" : "http:\/\/ph.dev"
}
14 changes: 14 additions & 0 deletions modules/phabricator/manifests/init.pp
@@ -0,0 +1,14 @@
# -*- tab-width: 2; indent-tabs-mode: nil -*-
# vim: set tabstop=2 shiftwidth=2 softtabstop=2 expandtab:

class phabricator {
file { '/vagrant/phabricator/conf/local/ENVIRONMENT':
ensure => present,
content => 'development'
}

file { '/vagrant/phabricator/conf/local/local.json':
ensure => present,
source => 'puppet:///modules/phabricator/local.json'
}
}
9 changes: 9 additions & 0 deletions modules/php/manifests/init.pp
Expand Up @@ -16,5 +16,14 @@
enable => true
}

ini_setting { 'fpm/pool.d/www.conf listen':
ensure => present,
path => '/etc/php5/fpm/pool.d/www.conf',
section => 'www',
setting => 'listen',
value => '127.0.0.1:9000',
notify => Service['php5-fpm']
}

Package['php5-fpm'] -> Service['php5-fpm']
}

0 comments on commit 5cd6c5c

Please sign in to comment.