Vagrant versionning: possible to specify box version on command line ?
67 views
Skip to first unread message
Francois Marot
unread,
Sep 24, 2015, 9:51:21 AM9/24/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Vagrant
Hello all,
I have a simple problem: I have many versions of a box, defined in a standard metadata.json file referenced in my Vagrantfile. I will have to regularly switch between versions (to test & compare regressions for example) of boxes. i'd like to avoid hardcoding the box version I want to use in my Vagrantfile (config.vm.box_version parameter). So is there a way to specify on the 'vagrant up' command-line which version I want to use ? The "--box-version" parameter available for some other command seems not supported :(
Alvaro Miranda Aguilera
unread,
Sep 24, 2015, 7:13:00 PM9/24/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Vagrant
You can also read environment variables using Ruby from within the Vagrantfile, so rather than having different folders, you could just "set MYBOXVERSION=0.0.1" then "vagrant box up" and in your Vagrantfile is reads box.version="ENV:$MYBOXVERSION" (this is not real Ruby) and it dynamically loads whatever you exported.