armbian-build/config/templates/config-vagrant.conf
2022-07-13 15:06:42 +02:00

30 lines
873 B
Plaintext

# DO NOT EDIT THIS FILE
#
# This is a Vagrant launcher file. To set up the configuration, use command line arguments to compile.sh
# While we are in config-vagrant.conf, we no longer need "vagrant" option
# So if "vagrant" wasn't removed from the command line by caller, we do it now
[[ "$1" == "vagrant" ]] && shift
# second argument can be a build parameter or a config file
unset VAGRANT_CONF
[[ $1 != *=* ]] && VAGRANT_CONF=$1 && shift
display_alert "Building and running the Vagrant box"
VAGRANT_INSTALL_LOCAL_PLUGINS=1 vagrant up || vagrant up
display_alert "SSH config for the Vagrant box"
vagrant ssh-config
display_alert "Trying to connect using SSH"
IFS=' ' vagrant ssh -c "cd armbian; sudo ./compile.sh $VAGRANT_CONF $*"
ret=$?
display_alert "Press <Enter> to halt the Vagrant box"
read
vagrant halt
# don't need to proceed further on the host
exit $ret