2
0
mirror of https://github.com/frappe/bench.git synced 2024-09-28 23:09:03 +00:00

Vagrant box addition

This commit is contained in:
Ameya Shenoy 2018-03-08 20:05:38 +05:30
parent 2a4607274b
commit 8b85e509c2
No known key found for this signature in database
GPG Key ID: 735490161CD5C91E
5 changed files with 187 additions and 3 deletions

73
vm/Vagrantfile vendored Normal file
View File

@ -0,0 +1,73 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "erpnext"
config.ssh.username = "frappe"
config.ssh.password = "frappe"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080
# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
# vb.memory = "1024"
# end
#
# View the documentation for the provider you are using for more
# information on available options.
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
# such as FTP and Heroku are also available. See the documentation at
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
# config.push.define "atlas" do |push|
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
# end
# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
# config.vm.provision "shell", inline: <<-SHELL
# sudo apt-get update
# sudo apt-get install -y apache2
# SHELL
end

View File

@ -5,4 +5,4 @@ apt-get install -y curl git wget vim python-dev gcc
# Install ERPNext
wget https://raw.githubusercontent.com/codingCoffee/bench/master/playbooks/install.py
sudo python install.py --production --user erpnext --mysql-root-password frappe --admin-password frappe
sudo python install.py --develop --user frappe --mysql-root-password frappe --admin-password frappe

View File

@ -0,0 +1,8 @@
#!/bin/bash -eux
# Install base requirements.
apt-get install -y curl git wget vim python-dev gcc
# Install ERPNext
wget https://raw.githubusercontent.com/codingCoffee/bench/master/playbooks/install.py
sudo python install.py --production --user frappe --mysql-root-password frappe --admin-password frappe

View File

@ -1,6 +1,7 @@
{
"builders": [{
"vm_name": "ERPNext-{{isotime \"20060102150405\"}}",
"vm_name": "ERPNext-Develop-{{isotime \"20060102150405\"}}",
"output_directory": "ERPNext-Develop-Images",
"type": "virtualbox-iso",
"boot_command": [
"<enter><wait><f6><esc><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
@ -71,7 +72,7 @@
}, {
"type": "shell",
"execute_command": "echo 'frappe' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"script": "scripts/debian_family/install_erpnext.sh"
"script": "scripts/debian_family/install_erpnext_develop.sh"
}, {
"type": "shell",
"execute_command": "echo 'frappe' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
@ -79,5 +80,14 @@
}, {
"type": "shell",
"script": "scripts/set_message.sh"
}],
"post-processors": [{
"type": "checksum",
"checksum_types": ["md5", "sha256", "sha512"]
}, {
"type": "vagrant",
"keep_input_artifact": true,
"output": "Vagrant_builds/ERPNext-Vagrant-Develop.box",
"vagrantfile_template": "Vagrantfile"
}]
}

93
vm/vm-production.json Normal file
View File

@ -0,0 +1,93 @@
{
"builders": [{
"vm_name": "ERPNext-Production-{{isotime \"20060102150405\"}}",
"output_directory": "ERPNext-Production-Images",
"type": "virtualbox-iso",
"boot_command": [
"<enter><wait><f6><esc><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"/install/vmlinuz<wait>",
" auto<wait>",
" console-setup/ask_detect=false<wait>",
" console-setup/layoutcode=us<wait>",
" console-setup/modelcode=pc105<wait>",
" debconf/frontend=noninteractive<wait>",
" debian-installer=en_US<wait>",
" fb=false<wait>",
" initrd=/install/initrd.gz<wait>",
" kbd-chooser/method=us<wait>",
" keyboard-configuration/layout=USA<wait>",
" keyboard-configuration/variant=USA<wait>",
" locale=en_US<wait>",
" netcfg/get_domain=vm<wait>",
" netcfg/get_hostname=ubuntu<wait>",
" grub-installer/bootdev=/dev/sda<wait>",
" noapic<wait>",
" preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg",
" -- <wait>",
"<enter><wait>"
],
"boot_wait": "10s",
"format": "ova",
"guest_os_type": "Ubuntu_64",
"headless": true,
"iso_url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.4-server-amd64.iso",
"iso_checksum": "6a7f31eb125a0b2908cf2333d7777c82",
"iso_checksum_type": "md5",
"ssh_username": "frappe",
"ssh_password": "frappe",
"ssh_port": 22,
"ssh_wait_timeout": "10000s",
"http_directory": "http",
"guest_additions_mode": "disable",
"virtualbox_version_file": ".vbox_version",
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
"export_opts": [
"--vsys", "0",
"--product", "ERPNext",
"--producturl", "https://erpnext.com",
"--vendor", "Frappe Techonologies",
"--vendorurl", "https://frappe.io",
"--description", "ERPNext Evaluation VM"
],
"shutdown_command": "echo 'frappe'|sudo -S shutdown -P now",
"vboxmanage": [
[ "modifyvm", "{{.Name}}", "--memory", "1024" ],
[ "modifyvm", "{{.Name}}", "--cpus", "1" ],
[ "modifyvm", "{{.Name}}", "--audio", "none" ],
[ "modifyvm", "{{.Name}}", "--natpf1", "vm_ssh,tcp,,3022,,22" ],
[ "modifyvm", "{{.Name}}", "--natpf1", "vm_http,tcp,,8080,,80" ]
]
}],
"provisioners": [{
"type": "shell",
"execute_command": "echo 'frappe' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"script": "scripts/debian_family/install_ansible.sh"
}, {
"type": "shell",
"execute_command": "echo 'frappe' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"script": "scripts/debian_family/setup.sh"
}, {
"type": "shell",
"execute_command": "echo 'frappe' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"script": "scripts/debian_family/install_erpnext_production.sh"
}, {
"type": "shell",
"execute_command": "echo 'frappe' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"script": "scripts/debian_family/cleanup.sh"
}, {
"type": "shell",
"script": "scripts/set_message.sh"
}],
"post-processors": [{
"type": "checksum",
"checksum_types": ["md5", "sha256", "sha512"]
}, {
"type": "vagrant",
"keep_input_artifact": true,
"output": "Vagrant_builds/ERPNext-Vagrant-Production.box",
"vagrantfile_template": "Vagrantfile"
}]
}