Scripting and Automation class code resource
Run sequence for manual setup and download of data (no vagrant provisioning):
- initialize.sh (this creates a cronjob for the main script to run as asked in the assignment)
- db-creation.sh (creates a database -> interactive)
- fetch-hook.sh (fetches the files and passes arguments to PHP for db entries)
More information can be found on the following links:
- Suitable vagrant boxes can be found at -> http://www.vagrantbox.es/
- Additional info on running scripts at vagrant up can be found here -> https://www.vagrantup.com/docs/provisioning/shell.html
- Info on installing and running vagrant -> https://www.youtube.com/watch?v=ZGUEjZckijA.
The Vagrant file has to be placed in your ~/vagrant folder. Any existing Vagrantfile should be deleted. THe shared folder must contain at minimum the parse.php script for vagrant guest to be able to find it. The commands to initialize and provision a VM are:
- vagrant box add {title} {url}
- vagrant init {title}
- vagrant up
- vagrant provision
This script must be placed in the ~/vagrant folder together with the Vagrantfile. This is the provision script which will install custom software on the VM when it is first booted.