Skip to content

Commit

Permalink
Merge pull request #83 from paperreduction/master
Browse files Browse the repository at this point in the history
Restructured the docs a little so that we can grow them a little easier.
  • Loading branch information
paperreduction committed Aug 4, 2014
2 parents 240d085 + 5db9cef commit f216a65
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 110 deletions.
11 changes: 11 additions & 0 deletions docs/faq/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FAQ
===

What is the difference between a role and a host?

Fabric Bolt hosts are globally known servers that Fabric Bolt can deploy to. When configuring a stage you need to add servers to it in order to deploy it. Each time you add a host you give it a role like app. This host is then used by the stage as a application-server. You can also create your own custom roles like ferret_server and reference this role in a task.

How do I run a deployment?

Fabric Bolt uses the concept of Project Stages to allow for sufficient customization for a deployment. You will need to configure at least one host, one project, and one project stage. Once those items are properly configured you can select a deployment task to run on the Project Stage page.

134 changes: 24 additions & 110 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
.. Fabric Bolt documentation master file, created by
sphinx-quickstart on Thu Nov 14 16:43:47 2013.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.


Fabric Bolt
===========

Fabric Bolt is a Python/Django project that allows you to deploy code stored in source control (a project) to a target server (host). Fabric Bolt provides convenient web interfaces to configure both the projects and the hosts. Additionally, deployment history and logs are stored so that you know who deployed what on which day.
Fabric Bolt is a Python/Django project that allows you to deploy code stored in source control (a project)
to a target server (host). Fabric Bolt provides convenient web interfaces to configure both the projects and
the hosts. Additionally, deployment history and logs are stored so that you know who deployed what on which day.

Build Status
------------
Expand All @@ -17,123 +16,38 @@ Build Status
.. image:: https://coveralls.io/repos/worthwhile/fabric-bolt/badge.png?branch=master
:target: https://coveralls.io/r/worthwhile/fabric-bolt?branch=master

Quickstart
----------

1. Install::

pip install fabric-bolt

2. Initialize settings file. (To specify file location, enter as the second argument.)::

fabric-bolt init [~/.fabric-bolt/settings.py]

3. Modify generated settings file to enter database settings.

4. Migrate db::

fabric-bolt syncdb --migrate

5. Run::
Users Guide
-----------

fabric-bolt runserver
.. toctree::
:maxdepth: 2

Note:
install/index
install/quickstart
install/nginx
usage/index
faq/index


If you have created a settings file at a different location than the default, you can use the --config option on any
command (besides the init command) to specify the custom file path. Alternatively, you can set an env variable: FABRIC_BOLT_CONF.

Overview
========

Hosts
-----

Hosts are simply an IP address or DNS name. Hosts are globally defined and can be targets for several projects in Fabric Bolt.

Host Roles
Developers
----------

It is common to have hosts that perform a particular role. For instance we might have a host that is a database server, one that is a web server, and one that is an app server (performing background tasks). By specifying what role each host plays, Fabric Bolt can customize the commands that run against each host during a deployment. So database servers have migrations run against them and web servers have their static assets collected to a central place, but not vice versa.

Sometimes a particular host serves as a particular role for one project, but a different role for another project. So roles are assigned to hosts when you configure them on a project.

Projects
--------

Projects are simply a deployment configuration. Each project can define a top level Project Configuration that includes things like the source control location, source code branch to use, host connection credentials, etc.

Projects also define their stages (more on stages below).

Project Stages
--------------

It is common for web developers to deploy their projects to a test/development/staging host for review before deploying to production. In Fabric Bolt we refer to those pieces of a deployment workflow as stages. In other words, we would always go through the following deployment stages for a particular project revision:

test -> staging -> production

Because stages can be as unique as the project code base itself, stages are configured per project and define stage specific configuration values that can override project configurations. Each Stage is simply a Host, Host Role, and Configuration values.

Deployment Tasks
----------------

Fabric Bolt uses a python package called Fabric to provide the core functionality of connecting to a remote host and executing shell commands on that host to perform a deployment. Because deployments typically have a large collection of commands that must be executed on a remote host, and those commands are usually grouped together to perform a particular deployment task, Fabric Bolt leverages Fabric tasks as deployment tasks. A deployment task is the same thing as a Fabric task, which is a collection of remote commands to run.

Deployment tasks are defined in a fabfile.py file that ships with Fabric Bolt. But you can provide your own fabfile.py if you want to customize the deployment tasks for a project.

Your deployment tasks are defined at the project level, but because Project Stages are the full configuration of a project and target host, deployment tasks are run from the project stage page.


Putting it Together
-------------------

If we diagram this simple structure, it looks something like this::

Project
|_ Configurations (git repo, git branch, code_root, etc.)
|_ Deployment Tasks
|
|_ Test Stage
| |_ Hosts (w/ roles)
| |_ Configurations (git branch, settings_file, etc.)
|
|_ Production Stage
|_ Hosts (w/ roles)
|_ Configurations (git branch, settings_file, etc.)

Running a Deployment
---------------------

Deployments are actually run against a project stage, since project stages fully define both the project and target hosts fully. To run a deployment:

1. Define your hosts
2. Create a project
3. Configure the project with the source control repo to be deployed (and any other necessary configs)
4. Add a stage
5. Configure the stage with at least one host
6. Select a deployment task to run against the stage
7. Review the deployment details and provide comments about the deployment
8. Click "Go!"

Deployments run in a background thread so you can navigate away from the deployment detail screen while a deployment is running. Fabric Bolt tracks the status of the deployment so that you can always come back later and check for success. However, from the deployment detail screen you can watch the live log of what commands are being run on the remote hosts while a deployment is running. After the deployment is complete the log is available for review. This is particularly helpful for resolving issues with failed deployments.

Users
-----

Users are configured in the system with one of three roles. For details on these roles see the http://yourdomain.com/user/permissions/ page.
.. toctree::
:maxdepth: 2

contributing/index

FAQ
===

What is the difference between a role and a host?
Reference
---------

Fabric Bolt hosts are globally known servers that Fabric Bolt can deploy to. When configuring a stage you need to add servers to it in order to deploy it. Each time you add a host you give it a role like app. This host is then used by the stage as a application-server. You can also create your own custom roles like ferret_server and reference this role in a task.
.. toctree::
:maxdepth: 1

How do I run a deployment?
changelog/index
license/index

Fabric Bolt uses the concept of Project Stages to allow for sufficient customization for a deployment. You will need to configure at least one host, one project, and one project stage. Once those items are properly configured you can select a deployment task to run on the Project Stage page.


Indices and tables
Expand Down
29 changes: 29 additions & 0 deletions docs/install/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,35 @@ the only thing running on the server.
This guide will step you through setting up a virtualenv, installing the required packages,
and configuring the basic web service.

Quickstart
----------

If you are familiar with running a django project that has been pip installed, you can use these steps to
get Fabric Bolt running. Otherwise skip this and use the detailed directions below.

1. Install::

pip install fabric-bolt

2. Initialize settings file. (To specify file location, enter as the second argument.)::

fabric-bolt init [~/.fabric-bolt/settings.py]

3. Modify generated settings file to enter database settings.

4. Migrate db::

fabric-bolt syncdb --migrate

5. Run::

fabric-bolt runserver

Note:

If you have created a settings file at a different location than the default, you can use the --config option on any
command (besides the init command) to specify the custom file path. Alternatively, you can set an env variable: FABRIC_BOLT_CONF.


Setting up an Environment
-------------------------
Expand Down
25 changes: 25 additions & 0 deletions docs/install/quickstart.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Fabric Bolt Quickstart
=======================

1. Install::

pip install fabric-bolt

2. Initialize settings file. (To specify file location, enter as the second argument.)::

fabric-bolt init [~/.fabric-bolt/settings.py]

3. Modify generated settings file to enter database settings.

4. Migrate db::

fabric-bolt syncdb --migrate

5. Run::

fabric-bolt runserver

Note:

If you have created a settings file at a different location than the default, you can use the --config option on any
command (besides the init command) to specify the custom file path. Alternatively, you can set an env variable: FABRIC_BOLT_CONF.
79 changes: 79 additions & 0 deletions docs/usage/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
Overview
========

Hosts
-----

Hosts are simply an IP address or DNS name. Hosts are globally defined and can be targets for several projects in Fabric Bolt.

Host Roles
----------

It is common to have hosts that perform a particular role. For instance we might have a host that is a database server, one that is a web server, and one that is an app server (performing background tasks). By specifying what role each host plays, Fabric Bolt can customize the commands that run against each host during a deployment. So database servers have migrations run against them and web servers have their static assets collected to a central place, but not vice versa.

Sometimes a particular host serves as a particular role for one project, but a different role for another project. So roles are assigned to hosts when you configure them on a project.

Projects
--------

Projects are simply a deployment configuration. Each project can define a top level Project Configuration that includes things like the source control location, source code branch to use, host connection credentials, etc.

Projects also define their stages (more on stages below).

Project Stages
--------------

It is common for web developers to deploy their projects to a test/development/staging host for review before deploying to production. In Fabric Bolt we refer to those pieces of a deployment workflow as stages. In other words, we would always go through the following deployment stages for a particular project revision:

test -> staging -> production

Because stages can be as unique as the project code base itself, stages are configured per project and define stage specific configuration values that can override project configurations. Each Stage is simply a Host, Host Role, and Configuration values.

Deployment Tasks
----------------

Fabric Bolt uses a python package called Fabric to provide the core functionality of connecting to a remote host and executing shell commands on that host to perform a deployment. Because deployments typically have a large collection of commands that must be executed on a remote host, and those commands are usually grouped together to perform a particular deployment task, Fabric Bolt leverages Fabric tasks as deployment tasks. A deployment task is the same thing as a Fabric task, which is a collection of remote commands to run.

Deployment tasks are defined in a fabfile.py file that ships with Fabric Bolt. But you can provide your own fabfile.py if you want to customize the deployment tasks for a project.

Your deployment tasks are defined at the project level, but because Project Stages are the full configuration of a project and target host, deployment tasks are run from the project stage page.


Putting it Together
-------------------

If we diagram this simple structure, it looks something like this::

Project
|_ Configurations (git repo, git branch, code_root, etc.)
|_ Deployment Tasks
|
|_ Test Stage
| |_ Hosts (w/ roles)
| |_ Configurations (git branch, settings_file, etc.)
|
|_ Production Stage
|_ Hosts (w/ roles)
|_ Configurations (git branch, settings_file, etc.)

Running a Deployment
---------------------

Deployments are actually run against a project stage, since project stages fully define both the project and target hosts fully. To run a deployment:

1. Define your hosts
2. Create a project
3. Configure the project with the source control repo to be deployed (and any other necessary configs)
4. Add a stage
5. Configure the stage with at least one host
6. Select a deployment task to run against the stage
7. Review the deployment details and provide comments about the deployment
8. Click "Go!"

Deployments run in a background thread so you can navigate away from the deployment detail screen while a deployment is running. Fabric Bolt tracks the status of the deployment so that you can always come back later and check for success. However, from the deployment detail screen you can watch the live log of what commands are being run on the remote hosts while a deployment is running. After the deployment is complete the log is available for review. This is particularly helpful for resolving issues with failed deployments.

Users
-----

Users are configured in the system with one of three roles. For details on these roles see the http://yourdomain.com/user/permissions/ page.

0 comments on commit f216a65

Please sign in to comment.