GitXplorerGitXplorer
a

fabric-digitalocean

public
8 stars
3 forks
0 issues

Commits

List of commits on branch master.
Verified
5b0192acd02bd496288325760a71f70064e1ecb5

Merge pull request #2 from andrewsomething/dependabot/add-v2-config-file

aandrewsomething committed 4 years ago
Verified
ef14b4cb00f341256b2a5656ed5e4833ac1364d4

Upgrade to GitHub-native Dependabot

ddependabot-preview[bot] committed 4 years ago
Unverified
1b86d69f14123397f94e82338c3128e5b39db0b5

Fix code block in README.

aandrewsomething committed 8 years ago
Unverified
b4dabe4cc86d3492f69fc261288b58ef3f290d69

Expand the README.

aandrewsomething committed 8 years ago
Unverified
23602e3e8480b9ba5ad3ef18950e56aaed10ef05

Fix license in setup.py

aandrewsomething committed 8 years ago
Unverified
2619b907ec3486524344138eb37890efe1a8573c

Move example fabfile to its own folder.

aandrewsomething committed 8 years ago

README

The README file for this repository.

=================== fabric-digitalocean

.. image:: https://travis-ci.org/andrewsomething/fabric-digitalocean.svg?branch=master :target: https://travis-ci.org/andrewsomething/fabric-digitalocean

fabric-digitalocean is a collection of tools aiming to make it easy to use Fabric_ and DigitalOcean_ together.

It was inspired by fabric-aws_

Installation

.. code-block::

pip install fabric-digitalocean

Usage

With fabric-digitalocean, you can decorate Fabric tasks to run on a set of DigitalOcean Droplet. The @droplets decorator can take a list of Droplet IDs, a tag, or a region as an argument. If you use a tag or region, it will be expanded to a list of all Droplets with that tag applied or in that region. They can also be used together.

The environmental variable FABRIC_DIGITALOCEAN_TOKEN must contain a DigitalOcean API token.

See below for an example:

.. code-block:: python

from fabric.api import task, run
from fabric_digitalocean.decorators import droplets


@task
@droplets(ids=[8043964, 7997777])
def task_by_ids():
    run('hostname')
    run('uptime')


@task
@droplets(tag='demo')
def task_by_tag():
    run('hostname')
    run('uptime')


@task
@droplets(region='nyc3')
def task_by_region():
    run('hostname')
    run('uptime')


@task
@droplets(region='nyc2', tag='demo')
def task_by_both():
    run('hostname')
    run('uptime')

Testing

To run the test suite, use:

.. code-block::

nosetests -v --with-coverage --cover-package=fabric_digitalocean

.. _Fabric: http://www.fabfile.org/ .. _DigitalOcean: https://www.digitalocean.com .. _fabric-aws: https://github.com/EverythingMe/fabric-aws