Package: oozappa
Fabric task runner and helper. Execute tasks via web browser.oozappa is 大雑把.Change logs.0.9.1Fixed bug, zappa init command generate illegal path. Thank you sugamasao!https://github.com/tsuyukimakoto/oozappa/pull/20Fixed image path of README file0.9.0Adding new subcommands to zappa.listrun_jobsetmanageRemoved rapid execution.Adding cli_only flag to Jobset.Now set cli_only flag using zappa manage. Now you can make Jobset can’t run from web ui.Decoupling webui from fabric execution(Error doesn’t occur even if connection reset).Show comfirm dialog before leaving web ui. and better ux. thank you yusuke furukawa.0.8.5Adding new feature, modify Jobsets sort order on jobsets page.Adding new feature, modify a Job data on environ page.Improve Fabric task’s behavior better when failed.You need db migration if you use 0.8.4 or below.Download zip archive fromhttps://github.com/tsuyukimakoto/oozappa/raw/master/migration/to_0.8.5.zip$ unzip to_0.8.5.zip && cd oozappa_to_0_8_5

If you have not alembic installed. You need install it using pip or any way you like.
Open alembic.ini and modify sqlalchemy.url to indicate your own oozappa's db. then

$ alembic upgrade 1e26220da1280.8.4Jobset runs exclusively from webui.0.8.3A zappa command added and removed oozappa.create_environment module.0.8.2Oozappa finds tasks from imported modules, not recursive.InstallInstall from Cheese Shop (pypi).$ pip install oozappaIf you use Xcode 5.1(above) and failed withclang: error: unknown argument: ‘-mno-fused-madd’, export flags before install.$ export CPPFLAGS=-Qunused-arguments
$ export CFLAGS=-Qunused-argumentsOozappa data models.EnvironmentEnvironment is a category that has fibfile directory and vars.py .A problem about fabric with large project is, too many fabric tasks and complicated task orders.So you should separate fabfile into domain category. That is Environment.JobJob is like a normal fabric execution command.note:fab task1 task2 is a job.JobsetJobset is oozappa operation unit.Jobset can contain multiple job, even extend over environments.Oozappa fabric structures.See sample oozappa project(https://github.com/tsuyukimakoto/oozappa/tree/master/sample/ops)..
├── common
│   ├── __init__.py
│   ├── files
│   ├── functions
│   │   ├── common_multiple_fabric_environment.py
│   ├── templates
│   │   └── sample_a.txt
│   └── vars.py
├── construction
│   ├── fabfile
│   │   ├── __init__.py
│   │   └── cloud.py
│   ├── templates
│   └── vars.py
├── deployment
│   ├── fabfile
│   │   ├── __init__.py
│   ├── templates
│   └── vars.py
├── production
│   ├── fabfile
│   │   ├── __init__.py
│   ├── templates
│   └── vars.py
└── staging
    ├── fabfile
    │   ├── __init__.py
    ├── templates
    │   └── sample_a.txt
    └── vars.pycommonis reserved directory.constructionand others are environment directory. These names except common are just example.varscommon and each environment’s vars.py might have oozappa.config.OozappaSetting instance named settings.
OozappaSetting is dict like object.common.vars.settingis updated by executed environment’svars.setting, so you can set base configuration to common.vars.setting and environment’s one overwrite it.Check printsetting task on staging environment.You can run fabric task within environment directory as usual.$ cd sample/ops/staging
$ fab printsetting
{'instance_type': 't1.micro', 'domain': 'localhost', 'sample_template_vars': {'sample_a': {'key_a_2': "a's 2 value from common.vars", 'key_a_1': "a's 1 value from stging.vars"}}, 'email': 'mtsuyuki at gmail.com'}See common/vars.py and staging/vars.py .templatesSame as vars,oozappa.fabrictools.upload_templatesearch template. upload_template is almost same asfabric.contrib.files.upload_template. oozappa’s upload_template doesn’t accept use_jinja, because oozappa’s upload_template pass use_jinja=True to fabric.contrib.files.upload_template.Jinja2 has inheritance template system and search template from multipul paths. fabric’s upload_template accept only one template_dir string not list.fabric doesn’t assume multiplu environment, so it’s reasonable.
Because of this, oozappa’s upload_template search template path is limited only one template_dir that found filename.
It mean that you can’t store child template and parent template separately.common/functionsCalloozappa.config.procure_common_functions() and add commons/functions directory to sys.path for convinient to using on multiple fabric environment.Run fabric task via web browser.Change directory to outside environment directory.$ cd ..
$ ls
common    production  staging
$ gunicorn -t 3600 -k flask_sockets.worker oozappa.webui:appRunning oozappa:app creates/tmp/oozappa.sqlite.Open your web browser and browsehttp://localhost:8000/.Rapid executionModifyRun fabric in raw’s left hand side input tostagingand clickrun_tasks. You can see what tasks exists.Then inputls psto right hand side input and clickrun_tasks.That’s it.Better way using sampleregister environment to db.Click environment button via top menu.Add new Environmentname: constructitonsort_order: 1execute_path: constructitonAdd 3 more.create job in each environments.Click environment you createdCreate new Job.Click task from Possible tasks in ordercreate jobsetClick jobset button via top menu.Click jobs you’d like to execute once.run jobsetClick navigation button or jobset button via top menu.Click jobset you’d like to execute.Clickrun jobsetbutton.Running log displaysRunning log.Reload page when jobset done. or Go to top(via navigation button)You see Execute Logs and show raw log when you click success (or fail).How to create your ownCreate common directoryChange directory your own oozappa.$ mkdir devops
$ cd devopsThen run zappa command.$ zappa init
Create common environment here? [y/N] : y
Sqlite database stored path. [/tmp/oozappa/data.sqlite] :
Log files stored path. [/tmp/oozappa] :
Create directory or exit? "/tmp/oozappa" [y/N] : y
created common directory. db/log file path and flask secret key are in common/vars.py.Attention!Default stored path is not for production use.
You should input your own file/directory path. Or data/results disapear when you reboot your machine or server.How to change settingsOpencommon/vars.pyand change settings.OOZAPPA_DBsqlite’s data store path.OOZAPPA_LOG_BASEDIRJobset execute log store directory path.Create environmentRunzappacommand with names option.$ zappa create_environment --names construction deployment
2014-04-20 16:43:26,543 INFO create environment : construction
2014-04-20 16:43:26,544 INFO create environment : deploymentThen you can write fabfile normally and execute via oozappa.