Ohai, some boxen::project love

This commit is contained in:
Will Farrington 2013-02-06 18:31:46 -08:00
parent 49ce321666
commit 7cf13dcb90
2 changed files with 57 additions and 11 deletions

View file

@ -4,18 +4,26 @@ Project manifests live in `modules/projects/manifests/$project.pp`. A
simple project manifest example: simple project manifest example:
```puppet ```puppet
class projects::boxen { class projects::trollin {
include qt # requires the qt module in Puppetfile include icu4c
include phantomjs
$dir = "${boxen::config::srcdir}/boxen" boxen::project { 'trollin':
dotenv => true,
repository { $dir: elasticsearch => true,
source => 'boxen/boxen' mysql => true,
} nginx => true,
redis => true,
ruby::local { $dir: ruby => '1.9.3',
version => 'system', source => 'boxen/trollin'
require => Repository[$dir]
} }
} }
``` ```
With the above, as long as our app is configured to listen on a **socket** at
`"#{ENV['BOXEN_SOCKET_DIR']}"/trollin`, you'll now be able to run its local
server and visit http://trollin.dev/ to access the app in dev.
For further documentation on how to use the `boxen::project` type,
take a look at the documentation in the
[source](https://github.com/boxen/puppet-boxen/blob/master/manifests/project.pp#L1-L46).

View file

@ -0,0 +1,38 @@
upstream <%= name %>.dev {
server unix:<%= scope.lookupvar "boxen::config::socketdir" %>/<%= name %>;
}
server {
access_log <%= scope.lookupvar "nginx::config::logdir" %>/<%= name %>.access.log main;
listen 80;
root <%= scope.lookupvar "boxen::config::srcdir" %>/<%= name %>/public;
server_name <%= name %>.dev;
client_max_body_size 50M;
error_page 500 502 503 504 /50x.html;
if ($host ~* "www") {
rewrite ^(.*)$ http://<%= name %>.dev$1 permanent;
break;
}
location = /50x.html {
root html;
}
location / {
if (-f $request_filename/index.html) {
rewrite (.*) $1/index.html break;
}
if (-f $request_filename.html) {
rewrite (.*) $1.html break;
}
if (!-f $request_filename) {
proxy_pass http://<%= name %>.dev;
break;
}
}
}