{ "info": { "author": "Glyn Jackson", "author_email": "me@glynjackson.org", "bugtrack_url": null, "classifiers": [], "description": "\nEC2 Deploy is a convenient deployment tool to facilitate server setup and code deployment across multiple AWS EC2 instances.\n\nWhy not use Git for deployment?\n-------------------------------\n\nGit is a powerful tool and over the years I have experimented deploying code with it.\nUsing a bare repo and git hooks was ideal for some time, but as my team and project grew this got unmanageable.\nPuppet is amazing, perfect in 90% of the cases, but for smaller clients can get tedious.\nEC2 Deploy is NOT a replacement for any of these services!\n\nKey Features\n\n* Create EC2 instances based on server template.\n* Creates environment variables for different instances staging/production for use in your project.\n* Deploys your codebase across multiple servers.\n\nInstallation Steps\n------------------\n\nYour project must have a ``requirements.txt`` file even if you don't have any!\n\nYour project must be using ``Git`` with a ``master`` and ``develop`` branch.\nMaster is used for release to production where develop is used for your staging server.\n\n1 - Install The EC2 Deploy Package\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nYou will need to ``pip`` install EC2 Deploy within your virtual environment.\nTo get the latest stable release from PyPi enter the following::\n\n pip install ec2-deploy\n\n2 - Import Fabric Commands\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nTo make use of the Fabric commands within EC2 Deploy you must import them within your own ``fabfile.py`` file.\nEC2 Deploy will automatically install Frabric as a dependency if you don't have it already.\nOnce you have your ``fabfile.py`` add the following import to the top of the file::\n\n from ec2_deploy.fab import *\n\n3 - Pick Server Template\n~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe next task is to pick your server template from the directory ``server-template``\nand edit the following files to reflect your own remote server setup.\n\nFor example the template ``AWS_Ubuntu14_04_LTS`` runs a Nginx, Gunicorn and Supervisor setup for Django Applications.\n\n * ``default`` - Nginx Site File.\n * ``supervisord.conf``.\n * ``gunicorn.conf.py``.\n * ``wsgi.py`` - Remote server WSGI.\n\nYou can create your own server template by copying an existing one, then modifying the file ``tasks.py``\nas required for your own setup.\n\nEnvironment Variables\n~~~~~~~~~~~~~~~~~~~~~\n\nEC2 Deploy gives you a very useful environment variable file with ``python-dotenv``, which\nreads values from a local .env file and loads them as environment variables for your application.\n\nFor your remote server you set these variables in ``vars_production.env`` and ``vars_staging.env`` found within the\nserver template used. EC2 Deploy will create your server environment variables based on the command used during\ndeployment or server creation.\n\nFor example ``fab staging deploy`` would copy the environment variables from the file ``vars_staging.env`` within\nyour server template folder as ``.env``.\n\nAt a minimum you must set the following environment variable within ``vars_production.env`` and ``vars_staging.env``::\n\n EC2_DEPLOY_SERVER_REPO=\"/srv/[APP_FOLDER]\"\n\nReplacing ``[APP_FOLDER]`` with the folder where your application is located on the remote server.\nYou can of course use any the same file to store your own custom variables for both your\nstaging and production environments.\n\nRunning a local version of your application requires you to create your own ``.env`` file with some additional variables.\n\nExample **required** local ``.env`` file::\n\n EC2_DEPLOY_AWS_SECRET_KEY = ''\n EC2_DEPLOY_SERVER_REPO=\"/srv/[APP_FOLDER]\"\n EC2_DEPLOY_AWS_KEY = ''\n EC2_DEPLOY_AWS_PRIVATE_FILE = ''\n EC2_DEPLOY_LOCAL_REPO = ''\n EC2_DEPLOY_TEMPLATE = 'ubuntu14custom'\n EC2_DEPLOY_AWS_USER = 'ubuntu'\n\nList of Fabric Commands\n-----------------------\n\nThere are a number of convenient Fabric scrips available to facilitate code deployment and other server tasks on AWS EC2.\n\n**Note:** Local environment must be configured correctly to run Fabric tasks *(see environment variables above)*.\n\n* ``fab staging/production instance`` - Creates an EC2 instance from an AMI and configures it based on template.\n * Creates new EC2 instance.\n * Updates OS.\n * Builds essential packages.\n * Deploy Master branch.\n * Installs requirements.\n * Server Setup, Gunicorn, Nginx and ports.\n * Celery Setup.\n * Restarts all services.\n\n* ``fab staging/production deploy`` - Deploys API codebase.\n * Deploy form master(staging)/release branch. Creates a release zip.\n * Updates environment variables.\n * Restarts all services.\n\n* ``fab staging/production celery_setup`` - Updates **Supervisor** and **Celery** processes from ``celery.conf``\n * Deploy form Master branch.\n * Updates each Celery worker start process.\n * Restarts Supervisor and Celery worker on the server.\n\n* ``fab staging/production environment_vars`` - Sets or Updates system environment variables.\n* ``fab staging/production reload`` - Restarts services.\n* ``fab staging/production update`` - Update OS site packages.\n* ``fab staging/production requirements`` - Runs ``pip install`` requirements.txt.\n* ``fab staging/production serversetup`` - Runs all the build server tasks.\n* ``fab staging/production create_swap`` - Creates Swap Memory", "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/glynjackson/ec2-deploy", "keywords": "ec2,deployment,aws,fabric,environment variables,amazon,boto", "license": "The MIT License", "maintainer": null, "maintainer_email": null, "name": "ec2_deploy", "package_url": "https://pypi.org/project/ec2_deploy/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/ec2_deploy/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/glynjackson/ec2-deploy" }, "release_url": "https://pypi.org/project/ec2_deploy/0.1.2/", "requires_dist": null, "requires_python": null, "summary": "EC2 Deploy is a convenient deployment tool to facilitate code deployment and other tasks to AWS EC2.", "version": "0.1.2" }, "last_serial": 1545181, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "64377c3ea75eaf96cd8b81ec1fe70380", "sha256": "670f99c0be4d38adc601fc09d08e425026c8594a581e6e076783260268e27a0f" }, "downloads": -1, "filename": "ec2_deploy-0.1.tar.gz", "has_sig": false, "md5_digest": "64377c3ea75eaf96cd8b81ec1fe70380", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10291, "upload_time": "2015-03-26T17:22:56", "url": "https://files.pythonhosted.org/packages/ad/a8/2fadb951a3ccfd7410c26a7b41b5e17683ee4a6dd6051313cbcc37749bbc/ec2_deploy-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "460a28e3006312f4190fe4ef2a298ab3", "sha256": "a1eaeb74214567e5778bfc6e880de4c8d0481a556a4f0bab4a1138e24a9a165a" }, "downloads": -1, "filename": "ec2_deploy-0.1.1.tar.gz", "has_sig": false, "md5_digest": "460a28e3006312f4190fe4ef2a298ab3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10237, "upload_time": "2015-03-26T17:28:58", "url": "https://files.pythonhosted.org/packages/c9/6c/0c74b42838ce1b7498a43ee04c4b6215297eeb81a5432f0223628d34de75/ec2_deploy-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "2d8e06bba8675713b1994160bb7781a3", "sha256": "ab3c949a6902e17bd92a1cc45b5a549d0115957a12126e1abc3f4c4ecbaf2658" }, "downloads": -1, "filename": "ec2_deploy-0.1.2.tar.gz", "has_sig": false, "md5_digest": "2d8e06bba8675713b1994160bb7781a3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10709, "upload_time": "2015-05-13T11:44:16", "url": "https://files.pythonhosted.org/packages/4c/58/6f70a286045ff6d286200f3f93d68c8f734324a8c29e569c75281c86b4ba/ec2_deploy-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2d8e06bba8675713b1994160bb7781a3", "sha256": "ab3c949a6902e17bd92a1cc45b5a549d0115957a12126e1abc3f4c4ecbaf2658" }, "downloads": -1, "filename": "ec2_deploy-0.1.2.tar.gz", "has_sig": false, "md5_digest": "2d8e06bba8675713b1994160bb7781a3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10709, "upload_time": "2015-05-13T11:44:16", "url": "https://files.pythonhosted.org/packages/4c/58/6f70a286045ff6d286200f3f93d68c8f734324a8c29e569c75281c86b4ba/ec2_deploy-0.1.2.tar.gz" } ] }