2
0
mirror of https://github.com/frappe/bench.git synced 2024-09-23 04:29:02 +00:00
bench/vm
2018-04-01 02:51:43 +05:30
..
http Fixes for VM build issue 2018-03-08 13:41:09 +05:30
scripts Changes for auto VM builds 2018-03-31 23:37:40 +05:30
build.py minor fixes 2018-04-01 02:51:43 +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 minor fixes 2018-04-01 02:51:43 +05:30
vm-production.json minor fixes 2018-04-01 02:51:43 +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.