|
48 | 48 |
|
49 | 49 | exec { 'install PHP MongoDB extension via pecl':
|
50 | 50 | command => 'pecl install mongo',
|
| 51 | + unless => "pecl info mongo", |
51 | 52 | notify => Service["php5-fpm"],
|
52 | 53 | }
|
53 | 54 |
|
|
120 | 121 |
|
121 | 122 | class development {
|
122 | 123 |
|
123 |
| - $devPackages = [ "curl", "git", "php-pear", "nodejs", "npm", "mongodb-10gen" ] |
| 124 | + $devPackages = [ "curl", "git", "php-pear", "nodejs", "npm", "mongodb-10gen", "capistrano" ] |
124 | 125 | package { $devPackages:
|
125 | 126 | ensure => "installed",
|
126 | 127 | require => Exec['apt-get update'],
|
127 | 128 | }
|
128 | 129 |
|
129 | 130 | exec { 'install less using npm':
|
130 |
| - command => 'npm install less -g' |
| 131 | + command => 'npm install less -g', |
| 132 | + require => Package["npm"], |
131 | 133 | }
|
132 | 134 |
|
133 | 135 | service { "mongodb":
|
|
143 | 145 | creates => "/vagrant/www/symfony"
|
144 | 146 | }
|
145 | 147 |
|
146 |
| - exec { 'install composer for symfony': |
147 |
| - command => 'curl -s http://getcomposer.org/installer | php -- --install-dir=/vagrant/www/symfony' |
| 148 | + exec { 'install composer for symfony when needed': |
| 149 | + command => 'curl -s http://getcomposer.org/installer | php -- --install-dir=/vagrant/www/symfony', |
| 150 | + onlyif => "test -e /vagrant/www/symfony/composer.json", |
148 | 151 | }
|
149 | 152 |
|
150 |
| - exec { 'run composer for symfony': |
| 153 | + exec { 'run composer for symfony when composer is used': |
151 | 154 | command => 'php composer.phar install --prefer-source',
|
152 |
| - cwd => "/vagrant/www/symfony" |
| 155 | + cwd => "/vagrant/www/symfony", |
| 156 | + onlyif => "test -e /vagrant/www/symfony/composer.json", |
| 157 | + } |
| 158 | + |
| 159 | + exec { 'run vendor installation from deps when composer is not used': |
| 160 | + command => 'php bin/vendors install', |
| 161 | + cwd => "/vagrant/www/symfony", |
| 162 | + unless => "test -e /vagrant/www/symfony/composer.json", |
153 | 163 | }
|
154 | 164 | }
|
155 | 165 |
|
|
0 commit comments