{ "info": { "author": "Vladimir Mihailenco", "author_email": "vladimir.webdev@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Repos\n=====\n\n- https://bitbucket.org/vmihailenco/fabdeploy\n- https://github.com/vmihailenco/fabdeploy\n\nQuickstart\n==========\n\nThere is full working example:\nhttps://github.com/vmihailenco/fabdeploy-example.\n\nCreate fabconf.py::\n\n from fabdeploy.api import DefaultConf\n\n class BaseConf(DefaultConf):\n django_dir = 'project_name'\n\n class StagingConf(BaseConf):\n address = 'user@staging-host.com'\n\n class ProdConf(BaseConf):\n address = 'user@prod-host.com'\n\nCreate fabfile.py::\n\n from fabdeploy import monkey; monkey.patch_all()\n from fabric.api import *\n from fabdeploy.api import *; setup_fabdeploy()\n\n\n @task\n def user_create():\n users.create.run()\n ssh.push_key.run(pub_key_file='~/.ssh/id_rsa.pub')\n\n @task\n def deploy():\n pass\n\nFabdeploy uses two system (linux) users:\n\n- ``sudo_user`` to perform tasks that require sudo right (``root`` by default).\n- ``user`` for other tasks (SSH user by default).\n\nIn Ubuntu ``root`` user is disabled by default. You can create special\n``fabdeploy`` user using following command::\n\n fab fabd.default_conf:address=user@host,sudo_user=user fabd.create_user\n\nThen you should tell fabdeploy to use new ``sudo_user``::\n\n class ProdConf(BaseConf):\n sudo_user = 'fabdeploy'\n\nList of available tasks::\n\n fab --list\n\nList of available variables::\n\n fab fabd.debug\n\nThis is useful to test configuration::\n\n $ fab fabd.conf:prod fabd.debug:django_path\n /home/prj/src/prj\n\nor::\n\n $ fab fabd.conf:prod fabd.debug:cpu_count\n 2\n\nor::\n\n $ fab fabd.conf:prod fabd.debug:current_time\n 2011.11.27-13.40\n\nTo deploy project you may use::\n\n $ fab fabd.conf:staging deploy\n $ fab fabd.conf:prod deploy\n\nExamples\n========\n\nControl where logs are stored\n-----------------------------\n\nfabconf.py::\n\n from fabdeploy.api import DefaultConf\n\n class ProdConf(DefaultConf):\n my_task__log_path = '/var/log/my_task'\n\nfabfile.py::\n\n from fabdeploy.api import Task\n\n class MyTask(Task):\n def do(self):\n print self.conf.log_path\n\n my_task = MyTask()\n\n\nOutput::\n\n $ fab fabd.conf:prod my_task\n /var/log/my_task\n\nYou can also temporarily set log path::\n\n $ fab fabd.conf:prod my_task:log_path='/var'\n /var\n\nThis works for all variables and all tasks.\n\nMultiple databases\n------------------\n\nfabconf.py::\n\n from fabdeploy.api import DefaultConf\n\n class ProdConf(DefaultConf):\n # default DB\n db_name = 'name1'\n db_user = 'user1'\n db_password = 'pass1'\n # logging DB\n loggingdb__db_name = 'name2'\n loggingdb__db_user = 'user2'\n loggingdb__db_password = 'pass2'\n\nfabfile.py::\n\n from fabdeploy import postgres\n\n @task\n def dump_db():\n postgres.dump.run() # dump default DB\n postgres.dump.run(_namespace='loggingdb__') # dump logging DB\n\nBuilt-in tasks customization\n----------------------------\n\nFabdeploy is written to be highly configurable. For example, there is\nbuilt-in ``tar`` task, which by default packs whole project, uploads it\nto server and unpacks it there.\n\nBut you can freely use it to upload custom dirs::\n\n from fabdeploy import tar\n\n @task\n def push_static():\n tar.push.run(\n src_dir=os.path.join(env.conf.django_ldir, 'static'),\n target_dir=posixpath.join(env.conf.django_dir, 'static'))\n\nDifferent DBs for development and production\n--------------------------------------------\n\nfabconf.py::\n\n from fabdeploy import api\n from fabdeploy.api import DefaultConf\n\n class DevConf(DefaultConf):\n address = 'user@localhost'\n db = getattr(fabdeploy, 'mysql')\n\n class ProdConf(DefaultConf):\n address = 'user@localhost'\n db = getattr(fabdeploy, 'postgres')\n\nfabfile.py::\n\n @task\n def execute():\n print env.conf.db.execute\n\nConfiguration\n=============\n\nThere are some conventions how to configure fabdeploy:\n\n- You should extend DefaultConf::\n\n from fabdeploy.api import DefaultConf\n\n class BaseConf(DefaultConf):\n pass\n\n- Each value can contain Python formatting::\n\n class BaseConf(DefaultConf):\n supervisor__log_dir = '%(var_dir)s/log/supervisor'\n\n- Remote pathes should have posfix ``_path``. You can and should use\n task ``fabd.mkdirs`` to create all remote dirs with one command. It\n will look like this::\n\n $ fab fabd.conf:staging_conf fabd.mkdirs\n mkdir --parents /path/to/dir1 /path/to/dir2 /path/to/dir3\n\n- Remote dirs (e.g. ``var``) have postfix ``_dir``.\n\n- Local pathes have postfix ``_lpath``. Local dirs have postfix\n ``_ldir``. This is similar to Fabric ``cd`` and ``lcd`` tasks.\n\n- Dirs (postfix ``_dir`` and ``_ldir``) and pathes (postfix ``_path``\n and ``_lpath``) can be Python lists. These lists will be passed to\n ``os.path.join()`` or ``posixpath.join()``. Previous example can\n look like this::\n\n from fabdeploy.api import DefaultConf\n\n class BaseConf(DefaultConf):\n supervisor__log_dir = ['%(var_dir)s', 'log', 'supervisor']\n\n- Function can be decorated with conf decorator. For example,\n ``current_time`` task looks like this::\n\n from fabdeploy.api import DefaultConf\n\n class BaseConf(DefaultConf):\n @conf\n def current_time(self):\n return datetime.datetime.utcnow().strftime(self.time_format)\n\n You can use it in your task like this::\n\n from fabdeploy.api import Task\n\n class MyTask(Task):\n def do(self):\n puts(self.conf.current_time)\n\n- You can configure each task individually::\n\n class BaseConf(DefaultConf):\n postgres__db_name = 'postgresql_db' # module=postres\n mysql__db_name = 'mysql_db' # module=mysql\n mysql__create_db__db_user = 'root' # module=mysql, task=create_db\n\nConfiguration is stored in task instance variable ``self.conf``. Each\ntask has its own copy of configuration. Configuration variables are\nsearched in following places:\n\n- task keyword argument ``var`` (``fab task:foo=bar``);\n- task instance method ``var()`` decorated with ``@conf()``;\n- key ``var`` in ``env.conf``, which is populated by ``fabd.conf`` task;\n- ask user to provide variable ``var`` using fabric prompt.\n\nGlobal configuration is stored in ``env.conf``.\n\nWriting your task\n=================\n\nYour task is class-based fabric class except fabdeploy manages\nconfiguration for you::\n\n from fabric.api import puts\n from fabdeploy.api import Task, conf\n\n class MessagePrinter(Task):\n @conf\n def message(self):\n if 'message' in self.conf:\n return self.conf.message\n return 'Hi!'\n\n def do(self):\n if self.conf.secret == '123':\n puts(self.conf.message)\n else:\n puts('huh?')\n\n message_printer = MessagePrinter()\n\nThen you can run this task like this::\n\n $ fab message_printer\n > secret = 123\n Hi!\n $ fab message_printer:message='Hello world!'\n > secret = 123\n Hello world!\n\nFabfile example\n===============\n\nTypical fabfile may look like this::\n\n from fabdeploy import monkey; monkey.patch_all()\n from fabric.api import *\n from fabdeploy.api import *; setup_fabdeploy()\n\n @task\n def install():\n users.create.run()\n ssh.push_key.run(pub_key_file='~/.ssh/id_rsa.pub')\n\n system.setup_backports.run()\n system.install_common_software.run()\n\n with settings(warn_only=True):\n postgres.create_role.run()\n postgres.create_db.run()\n postgres.grant.run()\n\n nginx.install.run()\n\n for app in ['supervisor']:\n pip.install.run(app=app)\n\n\n @task\n def setup():\n fabd.mkdirs.run()\n\n nginx.push_gunicorn_config.run()\n nginx.restart.run()\n\n supervisor.d()\n\n\n @task\n def deploy():\n fabd.mkdirs.run()\n release.create.run()\n\n postgres.dump.run()\n\n git.init.run()\n git.push.run()\n\n supervisor.push_configs.run()\n django.push_settings.run()\n gunicorn.push_config.run()\n\n virtualenv.create.run()\n virtualenv.pip_install_req.run()\n virtualenv.pip_install.run(app='gunicorn')\n virtualenv.make_relocatable.run()\n\n django.syncdb.run()\n django.migrate.run()\n django.collectstatic.run()\n\n release.activate.run()\n\n supervisor.update.run()\n supervisor.restart_program.run(program='celeryd')\n gunicorn.reload_with_supervisor.run()", "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/vmihailenco/fabdeploy/", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "django-fabdeploy-plus", "package_url": "https://pypi.org/project/django-fabdeploy-plus/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-fabdeploy-plus/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/vmihailenco/fabdeploy/" }, "release_url": "https://pypi.org/project/django-fabdeploy-plus/0.4/", "requires_dist": null, "requires_python": null, "summary": "Fabric deployment for Django", "version": "0.4" }, "last_serial": 789599, "releases": { "0.3.3": [], "0.3.4": [ { "comment_text": "", "digests": { "md5": "880daca26e897bd723c8f3820fa3b0fe", "sha256": "81ca743990edde2d59c23a3fbadc957b062179ca59af911589e85acb17b9621f" }, "downloads": -1, "filename": "django-fabdeploy-plus-0.3.4.tar.gz", "has_sig": false, "md5_digest": "880daca26e897bd723c8f3820fa3b0fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23241, "upload_time": "2012-02-22T15:40:42", "url": "https://files.pythonhosted.org/packages/29/f8/3b1018abd16036932ec8be1e66b0c2094cccb1a4cf14f9623a5feaf16903/django-fabdeploy-plus-0.3.4.tar.gz" } ], "0.3.5": [ { "comment_text": "", "digests": { "md5": "c88402588475fdd93b9e9bf2aaa78de6", "sha256": "a184ca1cea57913577b2f1bcd0663eff2c361f2c7c91925960095dd51eea3163" }, "downloads": -1, "filename": "django-fabdeploy-plus-0.3.5.tar.gz", "has_sig": false, "md5_digest": "c88402588475fdd93b9e9bf2aaa78de6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23572, "upload_time": "2012-03-10T10:55:24", "url": "https://files.pythonhosted.org/packages/d3/75/e8d847c22ac0ca4ec35678933a3c6c10927b393a839e336c6f184edef39b/django-fabdeploy-plus-0.3.5.tar.gz" } ], "0.3.6": [ { "comment_text": "", "digests": { "md5": "a75aaa5ecbaa94893900d73d02060a10", "sha256": "e36b8bdc9fd6de38b222d8e742ff30aa0af274e2b653ee78a51cd78857b5db0f" }, "downloads": -1, "filename": "django-fabdeploy-plus-0.3.6.tar.gz", "has_sig": false, "md5_digest": "a75aaa5ecbaa94893900d73d02060a10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24071, "upload_time": "2012-03-10T11:12:49", "url": "https://files.pythonhosted.org/packages/57/cb/88aa529907543b47d5beb0d75b0e9ab23f170e8c18f537f157b25acdace3/django-fabdeploy-plus-0.3.6.tar.gz" } ], "0.3.7": [ { "comment_text": "", "digests": { "md5": "e116cc915837c508329bee0bae2ba526", "sha256": "60d586cc24f444843f686d66230384a0d1c00100af6888d0f5d9e49be2b9f3c7" }, "downloads": -1, "filename": "django-fabdeploy-plus-0.3.7.tar.gz", "has_sig": false, "md5_digest": "e116cc915837c508329bee0bae2ba526", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23741, "upload_time": "2012-05-11T10:33:33", "url": "https://files.pythonhosted.org/packages/3f/fa/9ec5bb776e2f5c0507b17f781bda18cf13c9b72edeca8ef110274bc3817d/django-fabdeploy-plus-0.3.7.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "76c76eb92334c5ebda69a5c7e3fe738c", "sha256": "2f3298ba344220f13f159721bdae3db2cac03f0713e901ef996515b64c80389f" }, "downloads": -1, "filename": "django-fabdeploy-plus-0.4.tar.gz", "has_sig": false, "md5_digest": "76c76eb92334c5ebda69a5c7e3fe738c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23903, "upload_time": "2012-05-28T20:22:46", "url": "https://files.pythonhosted.org/packages/ae/91/9791f2dfabd0d8ab4b7d81a04face710d48bb4147f89ca00ef25ec0a7ac8/django-fabdeploy-plus-0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "76c76eb92334c5ebda69a5c7e3fe738c", "sha256": "2f3298ba344220f13f159721bdae3db2cac03f0713e901ef996515b64c80389f" }, "downloads": -1, "filename": "django-fabdeploy-plus-0.4.tar.gz", "has_sig": false, "md5_digest": "76c76eb92334c5ebda69a5c7e3fe738c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23903, "upload_time": "2012-05-28T20:22:46", "url": "https://files.pythonhosted.org/packages/ae/91/9791f2dfabd0d8ab4b7d81a04face710d48bb4147f89ca00ef25ec0a7ac8/django-fabdeploy-plus-0.4.tar.gz" } ] }