2018-02-20 09:20:12 +00:00
|
|
|
Vagrant.require_version '>= 2.0.0'
|
|
|
|
|
|
|
|
[ 'vagrant-vbguest', 'vagrant-docker-compose' ].each do |p|
|
|
|
|
unless Vagrant.has_plugin?(p)
|
|
|
|
raise "Please install missing plugin: vagrant plugin install #{p}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Vagrant.configure('2') do |config|
|
2019-01-10 00:13:11 +00:00
|
|
|
config.vm.define 'openbalena'
|
|
|
|
config.vm.hostname = 'openbalena-vagrant'
|
|
|
|
config.vm.box = 'bento/ubuntu-18.04'
|
|
|
|
|
|
|
|
config.vm.network "public_network",
|
|
|
|
use_dhcp_assigned_default_route: true
|
2018-02-20 09:20:12 +00:00
|
|
|
|
|
|
|
config.vm.synced_folder '.', '/vagrant', disabled: true
|
2019-01-10 00:13:11 +00:00
|
|
|
config.vm.synced_folder '.', '/home/vagrant/openbalena'
|
2018-02-20 09:20:12 +00:00
|
|
|
|
|
|
|
config.ssh.forward_agent = true
|
|
|
|
|
|
|
|
config.vm.provision :docker
|
|
|
|
|
2019-01-10 00:13:11 +00:00
|
|
|
$provision = <<-SCRIPT
|
2019-05-07 16:15:19 +00:00
|
|
|
DOCKER_COMPOSE_VERSION=1.24.0
|
|
|
|
|
2019-01-10 00:13:11 +00:00
|
|
|
touch /home/vagrant/.bashrc
|
|
|
|
grep -Fxq 'source /home/vagrant/openbalena/.openbalenarc' /home/vagrant/.bashrc || echo 'source /home/vagrant/openbalena/.openbalenarc' >> /home/vagrant/.bashrc
|
|
|
|
|
2019-01-10 10:33:15 +00:00
|
|
|
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
|
|
|
|
source "/home/vagrant/.nvm/nvm.sh" # This loads nvm
|
|
|
|
nvm install 10.15.0 && nvm use 10.15.0
|
2019-05-07 16:15:19 +00:00
|
|
|
|
|
|
|
# Install a newer version of docker-compose
|
|
|
|
(cd /usr/local/bin; \
|
|
|
|
sudo curl -o docker-compose --silent --location https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-Linux-x86_64; \
|
|
|
|
sudo chmod a+x docker-compose)
|
2019-01-10 00:13:11 +00:00
|
|
|
SCRIPT
|
2018-02-20 09:20:12 +00:00
|
|
|
|
2019-01-10 00:13:11 +00:00
|
|
|
config.vm.provision :shell, privileged: false, inline: $provision
|
2018-11-05 23:16:25 +00:00
|
|
|
|
2018-02-20 09:20:12 +00:00
|
|
|
end
|