]> gitweb.fluxo.info Git - puppet-drupal.git/commitdiff
Can choose between legacy drush or drush launcher
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 28 Jul 2020 13:52:53 +0000 (10:52 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 28 Jul 2020 13:52:53 +0000 (10:52 -0300)
manifests/drush.pp

index 927b168d97cbe83490fa8ffc1f3796cdaa7a4118..f7ef7911c8fbf805c465ba9067dee1538cfafbea 100644 (file)
@@ -1,5 +1,6 @@
 class drupal::drush(
-  $version = lookup('drupal::drush::version', undef, undef, '8.1.18')
+  $launcher = false,
+  $version  = lookup('drupal::drush::version', undef, undef, '8.3.5')
 ) {
   # Drush config folder
   file { '/etc/drush':
@@ -19,7 +20,6 @@ class drupal::drush(
     require => File['/etc/drush'],
   }
 
-  # TODO: future
   package { 'drush':
     ensure  => absent,
   }
@@ -48,9 +48,14 @@ 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",
+  }
+
   exec { 'getdrush':
     #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 https://github.com/drush-ops/drush/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",
     user    => 'root',
     cwd     => '/tmp',
     timeout => 0,