From 88fb5d18e243f11757b93566ac224cee6b27041d Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 28 Jul 2020 10:52:53 -0300 Subject: Can choose between legacy drush or drush launcher --- manifests/drush.pp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/manifests/drush.pp b/manifests/drush.pp index 927b168..f7ef791 100644 --- a/manifests/drush.pp +++ b/manifests/drush.pp @@ -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, -- cgit v1.2.3