d3f0a41489f9db1bea049a0409c152f0bc98235b
[pixelated-user-agent.git] / provisioning / modules / chromedriver / manifests / init.pp
1 # install chromedriver for functional tests
2 # we ship our local copy of chromedriver
3 # because latest versions are getting recurring errors on
4 # test/functional/features/login.feature#Then I should see the fancy interstitial
5
6 class chromedriver (
7   $release       = '1.0_beta1',
8   $chromedriver  = 'chromedriver_2.27_linux64.zip',
9   $google_chrome = 'google-chrome-stable_54.0.2840.100-1_amd64.deb',
10 ) {
11
12   exec { 'fetch_chromedriver':
13     command => "/usr/bin/wget https://github.com/pixelated/pixelated-user-agent/releases/download/${release}/${chromedriver}",
14     cwd     => '/var/tmp',
15     creates => "/var/tmp/${chromedriver}",
16   }
17
18   exec { 'fetch_google_chrome':
19     command => "/usr/bin/wget https://github.com/pixelated/pixelated-user-agent/releases/download/${release}/${google_chrome}",
20     cwd     => '/var/tmp',
21     creates => "/var/tmp/${google_chrome}",
22   }
23
24   exec { 'unpack_chromedriver':
25     command => "/usr/bin/unzip ${chromedriver} -d /usr/local/bin/",
26     cwd     => '/var/tmp/',
27     creates => '/usr/local/bin/chromedriver',
28   }
29
30   exec { 'install_google_chrome':
31     command => "/usr/bin/dpkg -i ${google_chrome} || /usr/bin/apt-get -y -f install",
32     cwd     => '/var/tmp/',
33     unless  => '/usr/bin/dpkg -l google-chrome-stable > /dev/null 2>&1',
34     require => [ Exec['apt_get_update'] ],
35   }
36
37 }