Tweak Vagrant to use env variables for S3 boxes, update instructions
Original commit: elastic/x-pack-elasticsearch@20e657113e
This commit is contained in:
parent
a2bc51da13
commit
55a828e15b
|
@ -22,9 +22,15 @@ Don't feel like compiling the entire box? No fear, there's a pre-baked box avai
|
|||
on S3. It is ~1.1gb to download:
|
||||
|
||||
```bash
|
||||
# must change into the vagrant directory first so that
|
||||
# synced folders continue working
|
||||
$ cd prelert-legacy/vagrant
|
||||
# Change into some random directory to download the box.
|
||||
# Doesn't matter where this goes, but *cannot* go into prelert-legacy/vagrant
|
||||
$ cd ~/some_directory
|
||||
|
||||
# Export the path to your prelert-legacy repo. This is so the box knows where
|
||||
# to sync the folders
|
||||
$ export PRELERT_SRC_HOME=/path/to/prelert-legacy
|
||||
|
||||
# Download the box from S3
|
||||
$ s3cmd get s3://prelert-elastic-dump/prelert_env.box
|
||||
# ...
|
||||
# Downloading...
|
||||
|
|
|
@ -24,6 +24,14 @@ Vagrant.configure(2) do |config|
|
|||
v.customize ["modifyvm", :id, "--memory", mem]
|
||||
v.customize ["modifyvm", :id, "--cpus", cpus]
|
||||
end
|
||||
|
||||
if File.expand_path(File.dirname(__FILE__)).include? "prelert-legacy/vagrant"
|
||||
puts "Syncing host's source directory [" + File.expand_path("../") + "] to [/home/vagrant/prelert/src]"
|
||||
config.vm.synced_folder "../", "/home/vagrant/prelert/src", mount_options: ["dmode=777,fmode=777"]
|
||||
else
|
||||
puts "Syncing host's source directory [" + File.expand_path(ENV['PRELERT_SRC_HOME']) + "] to [/home/vagrant/prelert/src] (via $PRELERT_SRC_HOME)"
|
||||
config.vm.synced_folder ENV['PRELERT_SRC_HOME'], "/home/vagrant/prelert/src", mount_options: ["dmode=777,fmode=777"]
|
||||
end
|
||||
|
||||
config.vm.provision :shell, path: "provision.sh"
|
||||
config.vm.synced_folder "../", "/home/vagrant/prelert/src", mount_options: ["dmode=777,fmode=777"]
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue