mirror of
https://github.com/frappe/bench.git
synced 2024-11-11 15:51:03 +00:00
357d497e55
This is being added to restart supervisor inside the virtual machine on boot, since the command 'bench update' breaks on boot, since the supervisor is not active. This is a bug in debian, which has been propogated to ubuntu, and this piece of code can be removed when the bug is fixed. |
||
---|---|---|
.. | ||
http | ||
scripts | ||
build.py | ||
Readme.md | ||
Vagrantfile | ||
vm-develop.json | ||
vm-production.json |
ERPNext VM Builder
Steps to build a VM Image
python build.py
builds a new VM
Requirements
- Bench should be installed.
- Ansible should be installed
How it works
Apart from the above the rest is handled by bench:
- Install prerequisites if not already installed
- virtualbox
- packer
- Cleanup
- Clean the required directories
- Generate the erpnext_develop.json and the erpnext_production.json
- Figure out the latest ubuntu iso available, get it's link and the checksum and generate the json files
- 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.- Depending on the VM being built, the
install_erpnext_develop.sh
or theinstall_erpnext_production.sh
is executed scripts/set_message.sh
sets welcome message (with update instructions) in the vm.scripts/cleanup.sh
writes zero to all the free space in the disk, it shrinks the disk image
- Set the correct permissions for the built Vagrant and Virtual Appliance Images
- Cleanup
- Delete the generated files from the required directories
- restart nginx
The requirements for this to run are Packer and Virtualbox. imports the base image in a virtual machine and boots it. It runs the following
For a build server
Running the build.py
script builds a vm and puts it in ~/public
. It also writes a latest.json
file in ~/public
with filename of the latest build and its md5sum.