jenkins-bot has submitted this change and it was merged.
Change subject: Phab role based on IEGReview
......................................................................
Phab role based on IEGReview
Change-Id: I55232b6fec40a75e14e249d8d208ae7c3c29390a
---
M puppet/hieradata/common.yaml
A puppet/modules/phabricator/manifests/config.pp
A puppet/modules/phabricator/manifests/init.pp
A puppet/modules/phabricator/templates/apache.conf.erb
A puppet/modules/role/manifests/phabricator.pp
5 files changed, 148 insertions(+), 0 deletions(-)
Approvals:
BryanDavis: Looks good to me, approved
jenkins-bot: Verified
diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml
index f3c6a31..2111196 100644
--- a/puppet/hieradata/common.yaml
+++ b/puppet/hieradata/common.yaml
@@ -155,6 +155,9 @@
mysql::default_db_name: wiki
mysql::root_password: vagrant
+phabricator::deploy_dir: /vagrant/phab
+phabricator::vhost_name: phabricator.local.wmftest.net
+
# We are masterless and have no need to run an agent.
puppet::agent::ensure: stopped
puppet::agent::enable: false
diff --git a/puppet/modules/phabricator/manifests/config.pp
b/puppet/modules/phabricator/manifests/config.pp
new file mode 100644
index 0000000..9d62f90
--- /dev/null
+++ b/puppet/modules/phabricator/manifests/config.pp
@@ -0,0 +1,18 @@
+# vim:set sw=4 ts=4 sts=4 et:
+
+# == Class: phabricator::config
+#
+# This class sets a phabricator config value
+#
+define phabricator::config(
+ $deploy_dir,
+ $value,
+){
+ include ::phabricator
+
+ exec { "phab_set_$title":
+ command => "$deploy_dir/phabricator/bin/config set ${title}
'${value}'",
+ require => Git::Clone['https://github.com/phacility/phabricator'],
+ unless => "grep '${title}'
$deploy_dir/phabricator/conf/local/local.json | grep '${value}'",
+ }
+}
diff --git a/puppet/modules/phabricator/manifests/init.pp
b/puppet/modules/phabricator/manifests/init.pp
new file mode 100644
index 0000000..bb18802
--- /dev/null
+++ b/puppet/modules/phabricator/manifests/init.pp
@@ -0,0 +1,90 @@
+# vim:set sw=4 ts=4 sts=4 et:
+
+# == Class: phabricator
+#
+# This class provisions an Apache vhost running the Phabricator application,
+# creates the application database.
+#
+class phabricator(
+ $deploy_dir,
+ $vhost_name,
+){
+ include ::apache
+ include ::apache::mod::rewrite
+ include ::elasticsearch
+ include ::mysql
+ include ::php
+
+ package { [
+ 'python-pygments',
+ 'python-phabricator',
+ 'php5-mailparse',
+ 'php5-ldap'
+ ]:
+ ensure => present,
+ }
+
+ git::clone { 'https://github.com/phacility/phabricator':
+ directory => "${deploy_dir}/phabricator",
+ remote => 'https://github.com/phacility/phabricator',
+ require => Class['::arcanist'],
+ }
+
+ # Add our vhost
+ apache::site { $vhost_name:
+ ensure => present,
+ content => template('phabricator/apache.conf.erb'),
+ require => Class['::apache::mod::rewrite'],
+ }
+
+ phabricator::config { "mysql.pass":
+ deploy_dir => $deploy_dir,
+ value => "${mysql::root_password}",
+ require => Class['::mysql'],
+ }
+
+ phabricator::config { "phabricator.base-uri":
+ deploy_dir => $deploy_dir,
+ value => "http://${vhost_name}${::port_fragment}/",
+ }
+
+ phabricator::config { "search.elastic.host":
+ deploy_dir => $deploy_dir,
+ value => "http://localhost:9200",
+ require => Class['::elasticsearch'],
+ }
+
+ phabricator::config { "pygments.enabled":
+ deploy_dir => $deploy_dir,
+ value => "true",
+ require => Package['python-pygments'],
+ }
+
+ phabricator::config { "metamta.mail-adapter":
+ deploy_dir => $deploy_dir,
+ value => "PhabricatorMailImplementationTestAdapter",
+ }
+
+ phabricator::config { "storage.upload-size-limit":
+ deploy_dir => $deploy_dir,
+ value => "100M",
+ }
+
+ # Setup databases
+ exec { 'phab_setup_db':
+ command => "$deploy_dir/phabricator/bin/storage upgrade --force",
+ require => Phabricator::Config['mysql.pass'],
+ unless => "$deploy_dir/phabricator/bin/storage status > /dev/null",
+ }
+
+ $phd = "$deploy_dir/phabricator/bin/phd"
+ service { 'phd':
+ ensure => running,
+ provider => base,
+ binary => $phd,
+ start => "${phd} start",
+ stop => "${phd} stop",
+ status => "${phd} status | grep -v DEAD",
+ require => Exec['phab_setup_db'],
+ }
+}
diff --git a/puppet/modules/phabricator/templates/apache.conf.erb
b/puppet/modules/phabricator/templates/apache.conf.erb
new file mode 100644
index 0000000..9193824
--- /dev/null
+++ b/puppet/modules/phabricator/templates/apache.conf.erb
@@ -0,0 +1,23 @@
+ServerName <%= @vhost_name %>
+ServerAdmin "https://mediawiki.org/wiki/Phabricator"
+
+# Change this to the path where you put 'phabricator' when you checked it
+# out from GitHub when following the Installation Guide.
+#
+# Make sure you include "/webroot" at the end!
+DocumentRoot <%= @deploy_dir %>/phabricator/webroot
+
+RewriteEngine on
+RewriteRule ^/rsrc/(.*) - [L,QSA]
+RewriteRule ^/favicon.ico - [L,QSA]
+RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA]
+
+<Directory />
+ Options FollowSymLinks
+ AllowOverride None
+ Require all denied
+</Directory>
+
+<Directory <%= @deploy_dir %>/phabricator/webroot>
+ Require all granted
+</Directory>
diff --git a/puppet/modules/role/manifests/phabricator.pp
b/puppet/modules/role/manifests/phabricator.pp
new file mode 100644
index 0000000..85c08fa
--- /dev/null
+++ b/puppet/modules/role/manifests/phabricator.pp
@@ -0,0 +1,14 @@
+# == Class: role::phabricator
+# Phabricator is an open source collection of web applications which help
+# software companies build better software.
+#
+# *Note*: The application is provisioned using an Apache named virtual host.
+# Once the role is enabled and provisioned use the URL
+# http://phabricator.local.wmftest.net:8080/ to access the site.
+class role::phabricator {
+ include ::phabricator
+
+ vagrant::settings { 'phabricator':
+ ram => 2000,
+ }
+}
--
To view, visit https://gerrit.wikimedia.org/r/178643
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I55232b6fec40a75e14e249d8d208ae7c3c29390a
Gerrit-PatchSet: 11
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Chad <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits