2
0
mirror of https://github.com/frappe/bench.git synced 2024-06-26 11:22:35 +00:00

added gitignore

This commit is contained in:
Ameya Shenoy 2018-03-15 11:11:17 +05:30
parent 8b85e509c2
commit 5456c4f25d
No known key found for this signature in database
GPG Key ID: 735490161CD5C91E
5 changed files with 172 additions and 18 deletions

143
.gitignore vendored
View File

@ -1,9 +1,138 @@
*.pyc
*.py~
*.swp
# MAC OS
.DS_Store
build/
dist/
*.egg-info/
# Vim Gitignore
## Swap
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-v][a-z]
[._]sw[a-p]
## Session
Session.vim
## Temporary
.netrwhist
*~
## Auto-generated tag files
tags
*.iso
# Python Gitignore
## Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
## C extensions
*.so
## Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
## PyInstaller
## Usually these files are written by a python script from a template
## before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
## Installer logs
pip-log.txt
pip-delete-this-directory.txt
## Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
## Translations
*.mo
*.pot
## Django stuff:
*.log
.static_storage/
.media/
local_settings.py
## Flask stuff:
instance/
.webassets-cache
## Scrapy stuff:
.scrapy
## Sphinx documentation
docs/_build/
## PyBuilder
target/
## Jupyter Notebook
.ipynb_checkpoints
## pyenv
.python-version
## celery beat schedule file
celerybeat-schedule
## SageMath parsed files
*.sage.py
## Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
## Spyder project settings
.spyderproject
.spyproject
## Rope project settings
.ropeproject
## mkdocs documentation
/site
## mypy
.mypy_cache/
# Packer Gitignore
## Cache objects
packer_cache/
## For built virtualmachines
*.ova
*.iso
## For built boxes
*.box

View File

@ -1,17 +1,42 @@
### ERPNext VM Builder
#### Steps to build a VM Image
* `/opt/packer build vm.json` builds a new VM
* `python build.py` builds a new VM
#### Requirements
* Bench should be installed.
* Ansible should be installed
#### How it works
Packer imports the base image in a virtual machine and boots it. It runs the following
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
* `scripts/debian_family/install_ansible.sh` sets up ansible on the vm.
* The `ansible/vm.yml` playbook sets up the dependencies, installs a bench and sets up a site. It also puts it into production.
* `scripts/set_message.sh` sets welcome message (with update instructions) in the vm.
* `scripts/zerofree.sh` writes zero to all the free space in the disk, it shrinks the disk image.
#### For a build server

View File

@ -10,7 +10,7 @@ import errno
from subprocess import check_output
OUTPUT_DIR = 'output-virtualbox-ovf'
PUBLIC_DIR = os.path.join(os.path.expanduser('~'), 'public')
PUBLIC_DIR = os.path.join(os.path.expanduser('~'), 'public')
def main():
install_virtualbox()

View File

@ -1,7 +1,7 @@
{
"builders": [{
"vm_name": "ERPNext-Develop-{{isotime \"20060102150405\"}}",
"output_directory": "ERPNext-Develop-Images",
"output_directory": "Builds",
"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>",
@ -87,7 +87,7 @@
}, {
"type": "vagrant",
"keep_input_artifact": true,
"output": "Vagrant_builds/ERPNext-Vagrant-Develop.box",
"output": "Builds//ERPNext-Vagrant-Develop-{{isotime \"20060102150405\"}}.box",
"vagrantfile_template": "Vagrantfile"
}]
}

View File

@ -1,7 +1,7 @@
{
"builders": [{
"vm_name": "ERPNext-Production-{{isotime \"20060102150405\"}}",
"output_directory": "ERPNext-Production-Images",
"output_directory": "Builds",
"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>",
@ -87,7 +87,7 @@
}, {
"type": "vagrant",
"keep_input_artifact": true,
"output": "Vagrant_builds/ERPNext-Vagrant-Production.box",
"output": "Builds/ERPNext-Vagrant-Production-{{isotime \"20060102150405\"}}.box",
"vagrantfile_template": "Vagrantfile"
}]
}