More automation for Vagrant environment

Disable VirtualBox GUI by default since running "./compile.sh vagrant"
will try to connect using "vagrant ssh" and launch the compile.sh in the
guest environment
Closes #747
This commit is contained in:
zador-blood-stained 2017-09-05 17:04:21 +03:00
parent 0e8baeda45
commit 4c84347490
2 changed files with 15 additions and 7 deletions

4
Vagrantfile vendored
View file

@ -39,8 +39,8 @@ Vagrant.configure(2) do |config|
config.vm.provider "virtualbox" do |vb|
vb.name = "Armbian Builder"
# comment this to disable the VirtualBox GUI
vb.gui = true
# uncomment this to enable the VirtualBox GUI
#vb.gui = true
# Tweak these to fit your needs.
#vb.memory = "8192"

View file

@ -6,17 +6,25 @@
# remove "vagrant" from the command line since "vagrant-guest" will be passed instead
shift
# TODO: copy the command line into a new config file on guest
# check and install vagrant-disksize
if ! grep -q '^vagrant-disksize' <(vagrant plugin list); then
display_alert "Trying to install vargant-disksize plugin"
vagrant plugin install vagrant-disksize
fi
display_alert "Building and running the Vagrant box"
vagrant up
# TODO: add docs about private key and conversions
display_alert "SSH config for the Vagrant box"
vagrant ssh-config
display_alert "Use 'vagrant halt' to stop the box"
display_alert "Trying to connect using SSH"
IFS=' ' vagrant ssh -c "cd armbian; sudo ./compile.sh vagrant-guest $*"
display_alert "Press <Enter> to halt the Vagrant box"
read
vagrant halt
# don't need to proceed further on the host
exit 0