Skip to content

Commit 383af68

Browse files
committed
Sets up support for librarian in composer install/update process
1 parent a92d400 commit 383af68

File tree

6 files changed

+111
-16
lines changed

6 files changed

+111
-16
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@
77
/vendor/
88
/bin/
99
/composer.phar
10+
/Puppetfile.lock
11+

.librarian/puppet/config

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
LIBRARIAN_PUPPET_DESTRUCTIVE: "false"

Puppetfile

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
forge "http://forge.puppetlabs.com"
2+
3+
mod 'puppetlabs/apache',
4+
:git => 'https://github.com/puppetlabs/puppetlabs-apache.git',
5+
:ref => '1.0.1'
6+
mod 'puppetlabs/apt',
7+
:git => 'https://github.com/puppetlabs/puppetlabs-apt.git',
8+
:ref => '1.4.2'
9+
mod 'puphpet/beanstalkd',
10+
:git => 'https://github.com/puphpet/puppet-beanstalkd.git',
11+
:ref => 'c4629f751d'
12+
mod 'tPl0ch/composer',
13+
:git => 'https://github.com/tPl0ch/puppet-composer.git',
14+
:ref => '1.2.1'
15+
mod 'puppetlabs/concat',
16+
:git => 'https://github.com/puppetlabs/puppetlabs-concat.git',
17+
:ref => '1.1.0'
18+
mod 'puphpet/drush',
19+
:git => 'https://github.com/puphpet/puppet-drush.git',
20+
:ref => '9c4881e90c'
21+
mod 'elasticsearch/elasticsearch',
22+
:git => 'https://github.com/elasticsearch/puppet-elasticsearch.git',
23+
:ref => '0.3.2'
24+
mod 'puppetlabs/git',
25+
:git => 'https://github.com/puppetlabs/puppetlabs-git.git',
26+
:ref => 'e033d7aad4'
27+
mod 'erwbgy/iptables',
28+
:git => 'https://github.com/erwbgy/puppet-iptables.git',
29+
:ref => 'v0.4.0'
30+
mod 'actionjack/mailcatcher',
31+
:git => 'https://github.com/actionjack/puppet-mailcatcher.git',
32+
:ref => 'v0.1.7'
33+
mod 'puppetlabs/mongodb',
34+
:git => 'https://github.com/puppetlabs/puppetlabs-mongodb.git',
35+
:ref => '0.7.0'
36+
mod 'puppetlabs/mysql',
37+
:git => 'https://github.com/puppetlabs/puppetlabs-mysql.git',
38+
:ref => '2.2.3'
39+
mod 'jfryman/nginx',
40+
:git => 'https://github.com/jfryman/puppet-nginx.git',
41+
:ref => 'v0.0.9'
42+
mod 'puppetlabs/ntp',
43+
:git => 'https://github.com/puppetlabs/puppetlabs-ntp.git',
44+
:ref => '3.0.4'
45+
mod 'puphpet/php',
46+
:git => 'https://github.com/puphpet/puppet-php.git',
47+
:ref => 'a1dad7828d'
48+
mod 'puppetlabs/postgresql',
49+
:git => 'https://github.com/puppetlabs/puppetlabs-postgresql.git',
50+
:ref => '3.3.3'
51+
mod 'puphpet/puphpet',
52+
:git => 'https://github.com/puphpet/puppet-puphpet.git',
53+
:ref => '001bc141fd'
54+
mod 'example42/puppi',
55+
:git => 'https://github.com/example42/puppi.git',
56+
:ref => 'v2.1.9'
57+
mod 'puppetlabs/rabbitmq',
58+
:git => 'https://github.com/puppetlabs/puppetlabs-rabbitmq.git',
59+
:ref => '4.0.0'
60+
mod 'puphpet/redis',
61+
:git => 'https://github.com/puphpet/puppet-redis.git',
62+
:ref => 'd9b3b23b0c'
63+
mod 'nanliu/staging',
64+
:git => 'https://github.com/nanliu/puppet-staging.git',
65+
:ref => '0.4.0'
66+
mod 'puppetlabs/stdlib',
67+
:git => 'https://github.com/puppetlabs/puppetlabs-stdlib.git',
68+
:ref => 'v2.2.1'

composer.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,16 @@
2828
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
2929
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
3030
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
31-
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
31+
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
32+
"Puphpet\\MainBundle\\Composer\\PuppetModules::downloadPuppetDependencies"
3233
],
3334
"post-update-cmd": [
3435
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
3536
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
3637
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
3738
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
38-
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
39+
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
40+
"Puphpet\\MainBundle\\Composer\\PuppetModules::downloadPuppetDependencies"
3941
]
4042
},
4143
"config": {

composer.lock

+13-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace Puphpet\MainBundle\Composer;
4+
5+
use Composer\Script\Event;
6+
use Symfony\Component\Yaml\Yaml;
7+
8+
abstract class PuppetModules
9+
{
10+
static public function downloadPuppetDependencies(Event $event)
11+
{
12+
$vendorDir = realpath($event->getComposer()->getConfig()->get('vendor-dir'));
13+
$rootDir = realpath($vendorDir . '/../');
14+
15+
echo 'Running librarian-puppet';
16+
17+
$cwd = getcwd();
18+
chdir($rootDir);
19+
exec('librarian-puppet install --clean 2>&1');
20+
chdir($cwd);
21+
}
22+
}

0 commit comments

Comments
 (0)