aboutsummaryrefslogtreecommitdiff
path: root/manifests/drush.pp
blob: 0ea7c13765068a9982c13e369f998d0b659bc7ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
class drupal::drush(
  $legacy_version  = lookup('drupal::drush::legacy_version', undef, undef, '8.3.5')
) {
  # Drush legacy config folder
  file { '/etc/drush':
    ensure => directory,
    owner  => root,
    group  => root,
    mode   => '0644',
  }

  # Drush legacy default configuration
  file { '/etc/drush/drushrc.php':
    ensure  => present,
    owner   => root,
    group   => root,
    mode    => '0644',
    source  => 'puppet:///modules/drupal/drushrc.php',
    require => File['/etc/drush'],
  }

  package { 'drush':
    ensure => absent,
  }

  #vcsrepo { "/usr/local/share/drush":
  #  ensure   => present,
  #  provider => git,
  #  source   => 'https://github.com/drush-ops/drush',
  #  revision => '401f034c59b031221d900bec7c2ba81d1331c284',
  #  owner    => 'root',
  #  group    => 'root',
  #}

  #file { "/usr/local/bin/drush":
  #  ensure  => '/usr/local/share/drush/drush',
  #  owner   => root,
  #  group   => root,
  #  require => [ Vcsrepo['/usr/local/share/drush'], Exec['getcomposer'] ],
  #}

  #exec { 'composer-drush':
  #  command     => '/usr/local/bin/composer global require drush/drush:dev-master',
  #  user        => 'vagrant',
  #  creates     => '/home/vagrant/composer/vendor/bin/drush',
  #  environment => [ 'COMPOSER_HOME="/vagrant"' ],
  #  require     => Exec['getcomposer'],
  #}

  # 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/${legacy_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',
  }

  # 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 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-launcher',
  }
}