aboutsummaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2020-07-28 11:05:59 -0300
committerSilvio Rhatto <rhatto@riseup.net>2020-07-28 11:05:59 -0300
commitfc9b052ffb93cb336b82149ecc805098a62f80fc (patch)
tree731f760c594678c0631c038df960ef37c348503f /manifests
parent88fb5d18e243f11757b93566ac224cee6b27041d (diff)
downloadpuppet-drupal-fc9b052ffb93cb336b82149ecc805098a62f80fc.tar.gz
puppet-drupal-fc9b052ffb93cb336b82149ecc805098a62f80fc.tar.bz2
Support both legacy drush and drush launcher
Diffstat (limited to 'manifests')
-rw-r--r--manifests/drush.pp35
1 files changed, 24 insertions, 11 deletions
diff --git a/manifests/drush.pp b/manifests/drush.pp
index f7ef791..96678fc 100644
--- a/manifests/drush.pp
+++ b/manifests/drush.pp
@@ -1,8 +1,7 @@
class drupal::drush(
- $launcher = false,
- $version = lookup('drupal::drush::version', undef, undef, '8.3.5')
+ $legacy_version = lookup('drupal::drush::legacy_version', undef, undef, '8.3.5')
) {
- # Drush config folder
+ # Drush legacy config folder
file { '/etc/drush':
ensure => directory,
owner => root,
@@ -10,7 +9,7 @@ class drupal::drush(
mode => '0644',
}
- # Drush default configuration
+ # Drush legacy default configuration
file { '/etc/drush/drushrc.php':
ensure => present,
owner => root,
@@ -21,7 +20,7 @@ class drupal::drush(
}
package { 'drush':
- ensure => absent,
+ ensure => absent,
}
#vcsrepo { "/usr/local/share/drush":
@@ -48,17 +47,31 @@ class drupal::drush(
# require => Exec['getcomposer'],
#}
- $download_url = $launcher ? {
- true => "https://github.com/drush-ops/drush-launcher/releases/latest/download/drush.phar",
- false => "https://github.com/drush-ops/drush/releases/download/${version}/drush.phar",
+ # Drush wrapper
+ file { '/usr/local/bin/drush':
+ ensure => present,
+ owner => root,
+ group => root,
+ mode => '0755',
+ source => 'puppet:///modules/drupal/drush',
+ }
+
+ # Drush Legacy
+ exec { 'getdrush_legacy':
+ command => "/usr/bin/wget https://github.com/drush-ops/drush/releases/download/${version}/drush.phar -O /usr/local/bin/drush-legacy && chmod +x /usr/local/bin/drush-legacy",
+ user => 'root',
+ cwd => '/tmp',
+ timeout => 0,
+ creates => '/usr/local/bin/drush-legacy',
}
- exec { 'getdrush':
+ # Drush Launcher
+ exec { 'getdrush_launcher':
#command => "/usr/bin/wget https://github.com/drush-ops/drush-launcher/releases/download/${version}/drush.phar -O /usr/local/bin/drush && chmod +x /usr/local/bin/drush",
- command => "/usr/bin/wget ${download_url} -O /usr/local/bin/drush && chmod +x /usr/local/bin/drush",
+ command => "/usr/bin/wget https://github.com/drush-ops/drush-launcher/releases/latest/download/drush.phar -O /usr/local/bin/drush-launcher && chmod +x /usr/local/bin/drush-launcher",
user => 'root',
cwd => '/tmp',
timeout => 0,
- creates => '/usr/local/bin/drush',
+ creates => '/usr/local/bin/drush-launcher',
}
}