2
0
mirror of https://github.com/frappe/bench.git synced 2024-09-24 04:59:01 +00:00
bench/vm/Readme.md

38 lines
1.3 KiB
Markdown
Raw Normal View History

2018-04-11 05:10:06 +00:00
## ERPNext VM Builder
2015-12-24 00:25:55 +00:00
2018-03-15 05:41:17 +00:00
2018-04-11 05:10:06 +00:00
### Steps to build a VM Image
2015-12-24 00:25:55 +00:00
2018-04-11 05:10:06 +00:00
* `python build.py` builds a new Production VM, a Dev VM and a Dev Vagrant Box
2018-03-15 05:41:17 +00:00
2018-04-11 05:10:06 +00:00
### Requirements
2018-03-15 05:41:17 +00:00
2018-04-11 05:10:06 +00:00
* Bench should be installed
2018-03-15 05:41:17 +00:00
* Ansible should be installed
2015-12-24 00:25:55 +00:00
2018-04-11 05:10:06 +00:00
### How it works
2015-12-24 00:25:55 +00:00
2018-03-15 05:41:17 +00:00
Apart from the above the rest is handled by bench:
* Install prerequisites if not already installed
- virtualbox
- packer
* Cleanup
- Clean the required directories
* Build the VM using packer
- Packer downloads the mentioned Ubuntu iso, boots a virtual machine and preceeds the preseed.cfg file into it in order to setup a clean Ubuntu OS
- Then packer uses ssh to enter the virtual machine to execute the required commands
- `scripts/debian_family/install_ansible.sh` sets up ansible on the vm.
2018-04-11 05:10:06 +00:00
- Depending on the VM being built, the `vm-develop.json` or the `vm-production.json` is used
2018-03-15 05:41:17 +00:00
- `scripts/set_message.sh` sets welcome message (with update instructions) in the vm.
2018-04-11 05:10:06 +00:00
- `scripts/cleanup.sh` writes zeros to all the free space in the disk, it shrinks the disk image
2018-03-15 05:41:17 +00:00
* Set the correct permissions for the built Vagrant and Virtual Appliance Images
* Cleanup
- Delete the generated files from the required directories
2018-04-11 05:10:06 +00:00
* Restart nginx
2018-03-15 05:41:17 +00:00
2015-12-24 00:50:48 +00:00
2018-04-11 05:10:06 +00:00
Running the `build.py` script builds the VMs and puts them in `~/Public`. It also creates the md5 hashes for the same, and puts them in the same folder.