GithubHelp home page GithubHelp logo

deploy-skeleton's Introduction

Deploy Skeleton

Uses Fabric, Puppet and Vagrant to effortlessly deploy an Ubuntu/Nginx/Supervisord/PostgreSQL/uWSGI/Django webapp.

Getting Started

Edit site.pp and specify your app specific parameters, i.e.:

$base_path = "<base path where you want to store your app, i.e. /var/webapps>"
$app_name = "<name of your webapp i.e. jabomly>"
$app_module_name = "<name of the Python module containing your Django WSGI module, i.e. jabomly"
$repo_url = "<git url of a repo containing your Django project/app, i.e. [email protected]:jodo/jabomly.git>"
$db_name = "<database name to use for your app>"
$db_username = "<database username to use for your app>"
$db_password = "<database password to use for your app>"

Then generate a deploy key and add it to your repo's deploy keys as per usual:

$ ssh-keygen -t rsa -C "[email protected]" -f manifests/modules/webworker/files/deploy_key_id_rsa

Local Testing

With configuration and deploy key setup done you can test a deploy locally using Vagrant:

$ vagrant up
$ vagrant ssh
$ sudo su ubuntu
$ cd <path to your webapp, i.e. /var/webapps/jabomly>
$ . ve/bin/activate
$ ./<app_module_name>/manage.py syncdb --migrate
$ ./<app_module_name>/manage.py collectstatic

After which your app should be live on http://localhost:4501.

Remote Deploying

To deploy remotely you need to add some more configuration in fabfile.py, i.e.:

HOST = "<hostname or IP of remote machine to deploy to, i.e. 178.26.131.86>"
REPO_HTTPS_URL = "<https url of a repo containing this deploy repo with your sepcific configurations, i.e. https://[email protected]/jodo/jabomly.git>"
APP_PATH = "<path where you want to store your app, i.e. /var/webapps/jabomly>"
APP_MODULE_NAME = "<name of the Python module containing your Django WSGI module, i.e. jabomly"

After which you can issue an initial provision using:

$ fab provision

issue a service reload using:

$ fab reload

and release new code using:

$ fab release

deploy-skeleton's People

Watchers

 avatar  avatar

Forkers

allenbhuiyan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.