forked from laravel/settler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·32 lines (26 loc) · 1.13 KB
/
build.sh
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
#!/usr/bin/env bash
# install required vagrant plugin to handle reloads during provisioning
vagrant plugin install vagrant-reload
# start with no machines
vagrant destroy -f
rm -rf .vagrant
time vagrant up --provider virtualbox 2>&1 | tee virtualbox-build-output.log
vagrant halt
vagrant package --base `ls ~/VirtualBox\ VMs | grep settler` --output virtualbox.box
ls -lh virtualbox.box
vagrant destroy -f
rm -rf .vagrant
time vagrant up --provider vmware_fusion 2>&1 | tee vmware-build-output.log
vagrant halt
# defrag disk (assumes running on osx)
/Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager -d .vagrant/machines/default/vmware_fusion/*-*-*-*-*/disk.vmdk
# shrink disk (assumes running on osx)
/Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager -k .vagrant/machines/default/vmware_fusion/*-*-*-*-*/disk.vmdk
# 'vagrant package' does not work with vmware boxes (http://docs.vagrantup.com/v2/vmware/boxes.html)
cd .vagrant/machines/default/vmware_fusion/*-*-*-*-*/
rm -f vmware*.log
tar cvzf ../../../../../vmware_fusion.box *
cd ../../../../../
ls -lh vmware_fusion.box
vagrant destroy -f
rm -rf .vagrant