Setting up a Linux-based Vagrant box and configuration, I am looking at the following problem:
During provision stage, I am installing Subversion. I would like, also during the provision stage, to edit the ~/.subversion/servers
file so that it gets necessary proxy settings.
I know how to do that (using sed
), however there is one catch.
~/.subversion
does not exist at this point.
The directory ~/.subversion
is not actually created until you first call svn info
, svn status
or whatever.
So I added to my Vagrantfile...
config.vm.provision "shell", inline: "svn info 2>/dev/null"
...and the command does get executed (with error, since of course there is no working directory to call info
on)...
==> default: Running provisioner: shell...
default: Running: inline script
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
...but there still is no ~/subversion
.
I don't quite understand why svn info
, which does the trick (of setting up ~/.subversion
) works fine when I am logged in to the virtual machine (via vagrant ssh
), but fails when executed during provisioning as displayed above.
How can I initialize ~/.subversion
during Vagrant provisioning stage (without actually accessing a real repo)?