This will make theVagrant.configure("2") do |config|
# ... other configuration
config.vm.provision "shell", path: "script.sh"
endVM executethe script at startup.
You can read more on this at https://www.vagrantup.com/docs/provisioning/basic_usage.html
In case you were trying to do something different, please share more details in order to better understand what you are trying to achieve.
Cheers
Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/precise64"
config.vm.provision :shell, path: "bootstrap.sh"
config.vm.provision :shell, path: "<Path-to...>/setup.sh"
end
#!/bin/bash;
composer install || {
php -r "readfile('https://getcomposer.org/installer');" | php;
#mv composer.phar /usr/local/bin/composer -n;
php composer.phar install;
}
echo "Create database";
touch database/database.sqlite;
echo "Migrate & Seed";
php artisan migrate;
php artisan db:seed;
php artisan serve --port=3000 --host localhost;default: bash: /tmp/vagrant-shell: /bin/bash;: bad interpreter: No such file or directory
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. /bin/bash;: bad interpreter: No such file or directory
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/8127ada5-f9dc-4083-af14-8676ded17c47%40googlegroups.com.--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
...
default: Composer (version 1.6.5) successfully installed to: /home/vagrant/composer.phar
default: Use it: php composer.phar
default: Do not run Composer as root/super user! See https://getcomposer.org/root for details
default: Composer could not find a composer.json file in /home/vagrant
default: To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
default: Create database
default: Migrate & Seed
default: Could not open input file: artisan
default: Could not open input file: artisan
default: Could not open input file: artisan
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.--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/56a149f1-c174-4682-8ed5-af137d82514c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.