Code Monkey home page Code Monkey logo

fabric-digitalocean's Introduction

fabric-digitalocean

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

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

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:

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:

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

fabric-digitalocean's People

Contributors

andrewsomething avatar dependabot-preview[bot] avatar

Stargazers

 avatar Alex Mills avatar Kevin avatar Ruslan Mamleev avatar Jeff Triplett avatar Ryan Castner avatar Ayman Magedy avatar  avatar

Watchers

 avatar James Cloos avatar  avatar

fabric-digitalocean's Issues

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.