2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-11 15:51:03 +00:00
bench/vm
Ameya Shenoy 357d497e55
restart supervisor on boot
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.
2018-03-23 15:04:34 +05:30
..
http Fixes for VM build issue 2018-03-08 13:41:09 +05:30
scripts restart supervisor on boot 2018-03-23 15:04:34 +05:30
build.py added gitignore 2018-03-15 11:11:17 +05:30
Readme.md added gitignore 2018-03-15 11:11:17 +05:30
Vagrantfile Vagrant box addition 2018-03-09 14:55:23 +05:30
vm-develop.json restart supervisor on boot 2018-03-23 15:04:34 +05:30
vm-production.json restart supervisor on boot 2018-03-23 15:04:34 +05:30

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 the install_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.