-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
82e1612
commit 457638f
Showing
5 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
puppet/environment/development/modules/drush/manifests/configure_composer.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
### | ||
### Configure required composer. | ||
### | ||
|
||
class drush::configure_composer { | ||
exec { 'move-composer-phar': | ||
command => 'mv composer.phar /usr/bin/composer/composer', | ||
path => '/usr/bin', | ||
cwd => '/root', | ||
before => File['/usr/local/bin/composer'], | ||
} | ||
|
||
## symlink composer to path | ||
file { '/usr/local/bin/composer': | ||
ensure => '/usr/bin/composer/composer', | ||
require => Exec['move-composer-phar'], | ||
notify => Exec['initialize-drush'], | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
puppet/environment/development/modules/drush/manifests/download_composer.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
### | ||
### Download required composer. | ||
### | ||
|
||
class drush::download_composer { | ||
exec { 'download-composer': | ||
command => 'wget https://getcomposer.org/installer', | ||
path => '/usr/bin', | ||
cwd => '/root', | ||
notify => Exec['move-composer-installer'], | ||
creates => [ | ||
'/usr/local/bin/drush', | ||
'/usr/bin/composer/vendor/drush/drush/drush', | ||
'/usr/bin/composer/composer', | ||
'/usr/bin/composer/composer.json', | ||
], | ||
provider => 'shell', | ||
} | ||
|
||
exec { 'move-composer-installer': | ||
command => 'mv installer composer-installer.php', | ||
path => '/usr/bin', | ||
cwd => '/root', | ||
onlyif => 'test -e /root/installer', | ||
refreshonly => true, | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
puppet/environment/development/modules/drush/manifests/init.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
### | ||
### Configures drush instance. | ||
### | ||
|
||
class drush { | ||
include php::install_rpm | ||
include php::enable_rpm | ||
include php::install_php | ||
include httpd::restart | ||
|
||
## enforce resource ordering: applies left resource first, if the left | ||
## resource changes, the right resource will refresh. | ||
## | ||
Class['php::install_rpm'] ~> | ||
Class['php::enable_rpm'] ~> | ||
Class['php::install_php'] ~> | ||
Class['httpd::restart'] | ||
} |
14 changes: 14 additions & 0 deletions
14
puppet/environment/development/modules/drush/manifests/install_composer.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
### | ||
### Install required composer. | ||
### | ||
|
||
class drush::install_composer { | ||
exec { 'install-composer': | ||
command => 'php composer-installer.php', | ||
path => '/usr/bin', | ||
cwd => '/root', | ||
environment => [ | ||
'COMPOSER_HOME=/usr/bin/composer', | ||
], | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
puppet/environment/development/modules/drush/manifests/install_drush.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
### | ||
### Install drush. | ||
### | ||
|
||
class drush::install_composer { | ||
include httpd | ||
|
||
exec { 'initialize-drush': | ||
command => "composer global require drush/drush:${version}", | ||
path => ['/usr/bin', '/usr/bin/composer'], | ||
environment => [ | ||
'COMPOSER_HOME=/usr/bin/composer', | ||
], | ||
provider => 'shell', | ||
require => File['/usr/local/bin/composer'], | ||
notify => Exec['update-composer'], | ||
} | ||
|
||
exec { 'update-composer': | ||
command => 'composer global update', | ||
cwd => '/usr/bin/composer/cache/files', | ||
environment => ['COMPOSER_HOME=/usr/bin/composer'], | ||
provider => 'shell', | ||
refreshonly => true, | ||
before => File['/usr/local/bin/drush'], | ||
notify => Exec['restart-httpd'], | ||
} | ||
|
||
## symlink drush to path | ||
file { '/usr/local/bin/drush': | ||
ensure => '/usr/bin/composer/vendor/drush/drush/drush', | ||
require => Exec['initialize-drush'], | ||
notify => [ | ||
Exec['restart-httpd'], | ||
Exec['drush-rc'], | ||
], | ||
} | ||
|
||
## clear cache and registry | ||
exec { 'drush-rc': | ||
command => 'drush rc', | ||
path => '/usr/local/bin', | ||
refreshonly => true, | ||
} | ||
} |