-
Notifications
You must be signed in to change notification settings - Fork 33
/
Vagrantfile
46 lines (39 loc) · 1.16 KB
/
Vagrantfile
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
remi = ["php72", "php73", "php74", "php80", "php82"]
composer = <<-SHELL
EXPECTED_SIGNATURE=$(curl https://composer.github.io/installer.sig)
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
then
>&2 echo 'ERROR: Invalid installer signature'
rm composer-setup.php
exit 1
fi
php composer-setup.php --quiet
rm composer-setup.php
mv composer.phar /usr/bin/composer
SHELL
Vagrant.configure("2") do |config|
config.vm.box = "centos/7"
config.vm.provision "shell", inline: <<-SHELL
if ! yum info remi-release
then
curl -O http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum -y install ./remi-release-7.rpm
fi
SHELL
remi.each do |repo|
config.vm.define "#{repo}" do |i|
i.vm.provision "shell", inline: <<-SHELL
yum-config-manager --enable remi-#{repo}
yum -y install php php-xml php-mbstring php-pecl-zip
if ! composer
then
#{composer}
fi
SHELL
end
end
end