-
Notifications
You must be signed in to change notification settings - Fork 5
/
Vagrantfile
36 lines (27 loc) · 988 Bytes
/
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = '2'
@script = <<SCRIPT
sudo yum install -y rpmdevtools rpm-devel rpm-build mock
cat > /tmp/build.sh <<EOF
rpmdev-setuptree
ln -s /opt/rpm/SPECS/consul-utils.spec /home/vagrant/rpmbuild/SPECS/
find /opt/rpm/SOURCES -type f -exec ln -s {} rpmbuild/SOURCES \\\;
spectool -g -R /home/vagrant/rpmbuild/SPECS/consul-utils.spec
rpmbuild -ba /home/vagrant/rpmbuild/SPECS/consul-utils.spec
cp /home/vagrant/rpmbuild/RPMS/x86_64/consul-utils*.rpm /opt/rpm
EOF
chmod 0755 /tmp/build.sh
su - vagrant /tmp/build.sh
SCRIPT
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.synced_folder '.', '/opt/rpm'
config.vm.provider "virtualbox"
config.vm.provider "vmware_fusion"
config.vm.box = "centos-7.0-base"
config.vm.provider :virtualbox do |vb|
vb.customize ['modifyvm', :id, '--cpus', 2]
vb.customize ['modifyvm', :id, '--memory', 2048]
end
config.vm.provision 'shell', inline: @script
end