Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F5327148
install.pp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 20, 7:07 AM
Size
5 KB
Mime Type
text/x-c++
Expires
Sun, Nov 22, 7:07 AM (10 h, 24 m)
Engine
blob
Format
Raw Data
Handle
314816
Attached To
rXR Xreate
install.pp
View Options
# Installs Phabricator.
#
# @summary Installs Arcanist, libphutil and Phabricator.
# @private
#
class phabricator::install {
assert_private()
# The `php::packages` class requires `Class['apt::update']` unconditionally,
# but the `apt::update` class may not have been defined. See
# https://github.com/voxpupuli/puppet-php/pull/323.
include apt
include git
$notify = Class['php::fpm::service']
# Ensure that the CLI is installed before any extensions are installed.
Class['php::cli'] -> Php::Extension <| |>
vcsrepo {
default:
ensure => 'latest',
provider => 'git',
user => $phabricator::admin_user,
group => $phabricator::group,
require => Ssh::Client::Config::User[$phabricator::admin_user],
notify => $notify;
'arcanist':
path => "${phabricator::install_dir}/arcanist",
source => $phabricator::arcanist_url;
'libphutil':
path => "${phabricator::install_dir}/libphutil",
source => $phabricator::libphutil_url;
'phabricator':
path => "${phabricator::install_dir}/phabricator",
source => $phabricator::phabricator_url;
'xreate-docs':
path => "${phabricator::install_dir}/xreate-docs",
source => $phabricator::xreate_docs_url
}
class refresh {
exec {
default:
refreshonly => true,
user => $phabricator::admin_user,
group => $phabricator::group,
cwd => "${phabricator::install_dir}",
path =>['/bin', '/usr/bin'],
logoutput => true,
subscribe => [
Vcsrepo['xreate-docs'],
File['phabricator/conf/local.json']
];
'arc liberate':
command => "${phabricator::install_dir}arcanist/bin/arc liberate --upgrade",
cwd => "${phabricator::install_dir}xreate-docs";
"${phabricator::install_dir}libphutil/scripts/phutil_rebuild_map.php libphutil/src/":;
'celerity map':
command => "${phabricator::install_dir}phabricator/bin/celerity map";
}
}
class storage {
$storage_upgrade_flags = shellquote(
[
'--force',
"--user=${phabricator::storage_upgrade_user}",
"--password=${phabricator::storage_upgrade_password}",
]
)
if !empty($phabricator::init_db) {
notice ("Restore DB from dump!")
exec {'db update':
command => "${phabricator::ctl} dump-restore ${phabricator::init_db}",
timeout => 1800,
onlyif => [
"test -e ${phabricator::ctl}",
"test -e ${phabricator::init_db}",
],
unless => '/usr/bin/mysql -uroot -e "show databases;" | grep phabricator',
path => ['/bin', '/usr/bin'],
subscribe => Class['phabricator::mysql'],
notify => [Class['php::fpm::service'], Service['phd']]
}
} else {
exec { 'db update':
command => Sensitive.new("${phabricator::install_dir}phabricator/bin/storage upgrade ${storage_upgrade_flags}"),
unless => '/usr/bin/mysql -uroot -e "show databases;" | grep phabricator',
timeout => 0,
user => $phabricator::admin_user,
group => $phabricator::group,
path =>['/bin', '/usr/bin'],
logoutput => true,
require => [
Class['php::cli'],
File['phabricator/conf/local.json'],
Vcsrepo['arcanist'],
Vcsrepo['libphutil']
],
subscribe => [
Vcsrepo['phabricator'],
Class['phabricator::mysql'],
File['phabricator/conf/local.json'],
],
notify => [Class['php::fpm::service'], Service['phd']]
}
}
}
class{'phabricator::install::refresh': }
class{'phabricator::install::storage': require=>Class['phabricator::install::refresh']}
#Repo
archive {"${phabricator::init_repo}":
extract => true,
extract_path => $phabricator::repo_dir,
creates => "${phabricator::repo_dir}/1",
cleanup => false,
user => $phabricator::daemon_user
}
$repositories = ['rXR']
$repositories.each | $rep | {
exec{"${phabricator::install_dir}phabricator/bin/repository update ${rep}":
refreshonly => true,
subscribe => Archive["${phabricator::init_repo}"],
path => '/usr/bin/',
logoutput => true
}
}
# These packages are required in order to compile XHPAST.
ensure_packages(['g++', 'make'])
exec { 'build_xhpast.php':
command => "${phabricator::install_dir}/libphutil/scripts/build_xhpast.php",
refreshonly => true,
require => [
Class['php::cli'],
Package['g++'],
Package['make'],
],
subscribe => Vcsrepo['libphutil'],
}
if $phabricator::install_fonts {
debconf { 'msttcorefonts/accepted-mscorefonts-eula':
ensure => 'present',
package => 'ttf-mscorefonts-installer',
type => 'select',
value => bool2str(true),
before => Package['ttf-mscorefonts-installer'],
}
package { 'ttf-mscorefonts-installer':
ensure => 'latest',
}
$font_file_ensure = 'link'
} else {
$font_file_ensure = 'absent'
}
file { "${phabricator::install_dir}/phabricator/resources/font/impact.ttf":
ensure => $font_file_ensure,
target => '/usr/share/fonts/truetype/msttcorefonts/Impact.ttf',
require => Vcsrepo['phabricator'],
}
}
Event Timeline
Log In to Comment