Merge "Make ./stack.sh optional"

This commit is contained in:
Jenkins 2015-12-22 13:08:55 +00:00 committed by Gerrit Code Review
commit 4078e92eaa
4 changed files with 18 additions and 7 deletions

View File

@ -45,3 +45,6 @@ the definition of the Virtual Machine spawned:
* **VAGRANT\_KURYR\_VM\_MEMORY**: To modify the RAM of the VM. Defaulted to: 4096
* **VAGRANT\_KURYR\_VM\_CPU**: To modify the cpus of the VM. Defaulted to: 2
* **VAGRANT\_KURYR\_RUN\_DEVSTACK**: Whether `vagrant up` should run devstack to
have an environment ready to use. Set it to 'false' if you want to edit
`local.conf` before run ./stack.sh manually in the VM. Defaulted to: true

View File

@ -2,8 +2,9 @@ VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
VM_MEMORY = ENV.fetch('VAGRANT_KURYR_VM_MEMORY', 4096)
VM_CPUS = ENV.fetch('VAGRANT_KURYR_VM_CPUS', 2)
VM_MEMORY = ENV.fetch('VAGRANT_KURYR_VM_MEMORY', 4096)
VM_CPUS = ENV.fetch('VAGRANT_KURYR_VM_CPUS', 2)
RUN_DEVSTACK = ENV.fetch('VAGRANT_KURYR_RUN_DEVSTACK', 'true')
config.vm.hostname = 'devstack'
@ -33,7 +34,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# For CentOS machines it needs to be specified
config.vm.synced_folder '.', '/vagrant'
config.vm.provision :shell, :path => 'vagrant.sh'
config.vm.provision :shell do |s|
s.path = 'vagrant.sh'
s.args = RUN_DEVSTACK
end
if Vagrant.has_plugin?('vagrant-cachier')
config.cache.scope = :box

View File

@ -3,6 +3,7 @@
set -e
BASHPATH=$(dirname "$0"\")
RUN_DEVSTACK="$1"
echo "Run script from $BASHPATH"
# Copied shamelessly from Devstack
@ -47,6 +48,9 @@ then
fi
# start devstack
echo "Start Devstack"
su "$OS_USER" -c "cd $DEVSTACK && ./stack.sh"
if $RUN_DEVSTACK; then
echo "Start Devstack"
su "$OS_USER" -c "cd $DEVSTACK && ./stack.sh"
else
echo "Virtual Machine ready. You can run devstack by executing '/home/vagrant/devstack/stack.sh'"
fi

View File

@ -4,7 +4,7 @@ export OS_USER=vagrant
export OS_HOST_IP=172.68.5.10
# run script
bash /vagrant/devstack.sh
bash /vagrant/devstack.sh "$1"
#set environment variables for kuryr
su "$OS_USER" -c "echo 'source /vagrant/config/kuryr_rc' >> ~/.bashrc"