{ "info": { "author": "Fr\u00f6jd", "author_email": "martin.sandstrom@frojd.se", "bugtrack_url": null, "classifiers": [], "description": "---\n\n# Fr\u00f6jd-Fabric\nA deployment toolkit built on top of Fabric.\n\nThe purpose of this library is to provide a stable python based deploy tool that covers a wide range a use cases,\nThose cases include Wordpress, Node.js and Django. We favor composition and customization by code before configuration.\n\n## Supports\n- Git\n- Rollbacks\n- A full Django deploy script with migrations\n- Virtualenv creation and activation\n- NPM management\n- Nginx\n- Uwsgi\n- Forever\n- Envfile handling\n- Celeryd\n- Wordpress\n- Composer\n\n## Requirements\nTo install Frojd-Fabric you need Python 2.7, virtualenv and pip.\n\n## Installation\nFrojd-Fabric can be installed through pip.\n\n### Stable\n`pip install frojd-fabric`\n\n### Develop\n`pip install git+git://github.com/Frojd/Frojd-Fabric.git@develop`\n\n\n## Project layout\n\nWe use the following project layout when deploying (it follows the same pattern as the ruby tool capistrano).\n\n```\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \n\u2502 releases \u2502\u2500\u2510 \n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \n \u251c\u2500\u25b6\u2502 201504121255 \u2502\u2500\u2500\u2510\n \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502\n \u2502 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u2502\n \u2514\u2500\u25b6\u2502 201504121213 \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u2502\n\u2502 current \u2502\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \n \u251c\u2500\u25b6\u2502 myapp.py \u2502 \n \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \n \u2502 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \n \u2514\u2500\u25b6\u2502 urls.py \u2502 \n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \n \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \n \u2502 .env \u2502\u25c0\u2500\u2510\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u2502\n\u2502 shared \u2502\u2500\u2510 \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u2502\n \u2514\u2500\u25b6\u2502 .env \u2502\u2500\u2500\u2500\u2518\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \n```\n\n\n## Commands/tasks\n\n|Task|Description|\n|----------|:-------------:|\n|setup|Initializes you application by creating the necessary directories/files. Must run first|\n|deploy|Performs the actual deployment|\n|rollback|Removes the current release and reactivates the previous|\n\n```\n>>> fab stage setup\n>>> fab stage deploy\n```\n\n\n## How does it work\nFrojd-Fabric consists of three parts, stages, recipes and extensions.\n\n### Stages\nThe server stage is stored as a file called {stage}.py and it specifies both the recipe and some of the extensions (depending on recipe). It also defines deployment settings by both loading them from a fabricrc.txt file or hard coded in stage file.\n\nThe stages are usually placed in a folder called `envs` or `stages` and are organized like this:\n\n```\nenvs\n\t__init__.py\n\tdemo.py\n\tprod.py\n```\n\n**Example: envs/__init__.py**\n\nThe init file specifies the stages you want to activate. It might also contain stage wide settings, such as repository url.\n\n```python\nfrom demo import demo\nfrom prod import prod\n\nenv.repro_url = \"git@github.com:Frojd/Yourrepro.git\"\n```\n\n**Example: envs/demo.py**\n\nAnd here is a stage file example, this file represents the demo environment and uses the wordpress recipe.\n\n```python\nfrom fabric.state import env\nfrom fabric.decorators import task\nfrom frojd_fabric.utils import get_stage_var\n\n@task\ndef demo():\n\tfrom frojd_fabric.recipes import wordpress\n\t\n\tenv.stage = \"demo\"\n\tenv.hosts = [\"example.com\"]\n\tenv.user = \"deploy\"\n\tenv.password = \"password\"\n```\n\nConfigurations are usually loaded through a fabric settings file. Hard coded values should be avoided in most cases.\n\n```python\n\tenv.hosts = [get_stage_var(\"HOST\")]\n\tenv.user = get_stage_var(\"USER\")\n\tenv.password = get_stage_var(\"PASSWORD\")\n```\n\nIn the sample below `get_stage_var(\"USER\")` will look for a parameter named `DEMO_USER` (since env.stage was named demo) in the fabricrc.txt file.\n\nHere is a more [detailed example](https://github.com/Frojd/Frojd-Fabric/blob/develop/examples/django/fabricrc.template.txt).\n\n### Recipes\nA recipe is essentially the glue between a stage and extensions. It includes the necessary extensions and applies custom configurations that combine different extensions.\n\n### Extensions\nIs esentially a way of interacting with various server tools and software, such as nginx or uwsgi. Should be kept small, flexible and modular.\n\n## Parameters\nFrojd-Fabric requires a couple of parameters to work, the standard params (listed below) are required to any setup, while other params are depending on recipe or extension.\n\n### Standard params\n\n|Parameter|Description|\n|----------|:-------------:|\n|[hosts](http://docs.fabfile.org/en/1.10/usage/env.html#hosts)|Deployment host target|\n|[user](http://docs.fabfile.org/en/1.10/usage/env.html#user)|Username|\n|[password](http://docs.fabfile.org/en/1.10/usage/env.html#password)|SSH Password|\n|[key_filename](http://docs.fabfile.org/en/1.10/usage/env.html#key-filename)|Absolute path to SSH key file|\n|app_path|The path on the remote server where the application should be deployed (needs to be absolute)|\n|source_path|If you have a subfolder you want to use as a application front (such as `src`)|\n|current_path|Path where you want your latest release to be linked *(Optional)*|\n|stage|The name of your deployment stage (such as `prod`)|\n\nHere's is a [full list of the built in Fabric env vars](http://docs.fabfile.org/en/1.10/usage/env.html#environment-as-configuration)\n\n#### Git\n|Parameter|Description|\n|----------|:-------------:|\n|repro_url|Url to your git repro (example: `git@github.com:Frojd/Frojd-Fabric.git`|\n|branch|Name of your repro branch, defaults to master *(Optional)*|\n\n**TODO: Add more extension configurations**\n\n## Examples\nThis project ships with examples for Django and Wordpress (just check `examples/*`)\n\n## Debugging\nSimple, just import `debug` from frojd_fabric.api, then run it with your command.\nDebug will then generate a log file called `frojd_fabric-debug.log`.\n\nExample: `fab debug demo deploy`\n\n\n## Tests\n\nTests can be run with `python runtests.py`, this will run the entire suite.\n\nIt also possible to run a specific case: `python runtests.py tests.test_api.TestApi` \n\n... or a specific unittest:\n`test_deploy_rollback python runtests.py tests.test_api.TestApi.test_deploy_rollback`\n\n### Writing tests\n\nAll tests should reside in the `tests` directory and prefixed `test_*`, to include a test in the main suite add the test path in `runtests.py`.\n\n\n## Contributing\nWant to contribute? Awesome. Just send a pull request.\n\n\n## License\nFrojd-Fabric is released under the [MIT License](http://www.opensource.org/licenses/MIT).", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/frojd/frojd-fabric", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "frojd-fabric", "package_url": "https://pypi.org/project/frojd-fabric/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/frojd-fabric/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/frojd/frojd-fabric" }, "release_url": "https://pypi.org/project/frojd-fabric/1.1.1/", "requires_dist": null, "requires_python": null, "summary": "A simple to use deployment toolkit built on top of Fabric", "version": "1.1.1" }, "last_serial": 1631010, "releases": { "1.0.2": [ { "comment_text": "", "digests": { "md5": "d64cae71fd26fa38e1b50b73e841ec58", "sha256": "96bb6d696581bd89e2c7f6a46778cd4ab91b42b90844aba9efb38cbabc143bec" }, "downloads": -1, "filename": "frojd-fabric-1.0.2.tar.gz", "has_sig": false, "md5_digest": "d64cae71fd26fa38e1b50b73e841ec58", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9455, "upload_time": "2015-03-18T20:11:01", "url": "https://files.pythonhosted.org/packages/c6/45/4619a033b4f119ff15558282f66296a8a042d75329e25f5e927b5f6af331/frojd-fabric-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "9b32ab40612f231bc58ba8ee5776f102", "sha256": "408812eceb29e81ceb064507f02d6fadf59d2294a0f4d33fc20629c48223f239" }, "downloads": -1, "filename": "frojd-fabric-1.0.3.tar.gz", "has_sig": false, "md5_digest": "9b32ab40612f231bc58ba8ee5776f102", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9498, "upload_time": "2015-03-18T20:22:39", "url": "https://files.pythonhosted.org/packages/82/ff/141c983fad477fbeb175191981cf628d702b03ba699d67fb7feed2075c81/frojd-fabric-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "73a6dd82dbe30d922c918a60e51792c6", "sha256": "e9b1a5bb6f6b32b1b20df96abc947bb561f497f857939ecb8489c6a49dd0706a" }, "downloads": -1, "filename": "frojd-fabric-1.0.4.tar.gz", "has_sig": false, "md5_digest": "73a6dd82dbe30d922c918a60e51792c6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9586, "upload_time": "2015-03-26T22:36:20", "url": "https://files.pythonhosted.org/packages/05/27/cd9ddd954a312711452ed8707af9f1536ea7ad1d9c96f322e745fcfa0cd5/frojd-fabric-1.0.4.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "f94df09422ce4da9f7bef1dfd8b45ced", "sha256": "3827160598a85858b527a2fc8a7a54fba41024be6e1e3a4d3586c640d59f2fd2" }, "downloads": -1, "filename": "frojd-fabric-1.1.0.tar.gz", "has_sig": false, "md5_digest": "f94df09422ce4da9f7bef1dfd8b45ced", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11142, "upload_time": "2015-06-22T09:35:28", "url": "https://files.pythonhosted.org/packages/71/34/ab71cbcb44e9837abc8815d34bf08ec1f136189f8107f58a270648631c47/frojd-fabric-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "ddfd294ae34cc8a2b10a3aeeb17eb943", "sha256": "22cf92cf804f34307ca843d49887a9e63eb5f02209f374b65710d85f020fb624" }, "downloads": -1, "filename": "frojd-fabric-1.1.1.tar.gz", "has_sig": false, "md5_digest": "ddfd294ae34cc8a2b10a3aeeb17eb943", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11180, "upload_time": "2015-07-13T11:13:38", "url": "https://files.pythonhosted.org/packages/bc/79/d12519c4e87c02cf904c6aa1859735d92553bc95264098aa0c468758a459/frojd-fabric-1.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ddfd294ae34cc8a2b10a3aeeb17eb943", "sha256": "22cf92cf804f34307ca843d49887a9e63eb5f02209f374b65710d85f020fb624" }, "downloads": -1, "filename": "frojd-fabric-1.1.1.tar.gz", "has_sig": false, "md5_digest": "ddfd294ae34cc8a2b10a3aeeb17eb943", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11180, "upload_time": "2015-07-13T11:13:38", "url": "https://files.pythonhosted.org/packages/bc/79/d12519c4e87c02cf904c6aa1859735d92553bc95264098aa0c468758a459/frojd-fabric-1.1.1.tar.gz" } ] }