aboutsummaryrefslogtreecommitdiffstats
path: root/vagrant
diff options
context:
space:
mode:
Diffstat (limited to 'vagrant')
-rw-r--r--vagrant/Vagrantfile14
1 files changed, 14 insertions, 0 deletions
diff --git a/vagrant/Vagrantfile b/vagrant/Vagrantfile
index c6db23620aa..84836d05e72 100644
--- a/vagrant/Vagrantfile
+++ b/vagrant/Vagrantfile
@@ -58,4 +58,18 @@ Vagrant.configure("2") do |config|
yum update -y
hostname localhost
SHELL
+
+ # Add settings for Vespa and dev tools as the default user, usually 'vagrant' (privileged: false)
+ # NOTE: adding these settings to .bashrc would break vagrant suspend/resume/provision
+ # due to env vars modified by /opt/rh/devtoolset-7/enable.
+ config.vm.provision "shell", privileged: false, inline: <<-SCRIPT
+ grep -l VESPA_HOME ~/.bash_profile >/dev/null || (\
+ printf "%s\n" \
+ 'export VESPA_HOME=$HOME/vespa' \
+ 'export PATH=$PATH:$VESPA_HOME/bin' \
+ 'source /opt/rh/rh-maven35/enable' \
+ 'source /opt/rh/devtoolset-7/enable' \
+ >> ~/.bash_profile )
+ SCRIPT
+
end