Giter Site home page Giter Site logo

err-fabric's Introduction

err-fabric

This plugin allows you to invoke Fabric commands using Errbot.

From the Fabric documentation:

Fabric is:

  • A tool that lets you execute arbitrary Python functions via the command line;
  • A library of subroutines (built on top of a lower-level library) to make executing shell commands over SSH easy and Pythonic.

Installation

You must provide your own fabfile. For an overview on how to use Fabric, see their Tutorial.

You must also provide your own SSH config file. See Leveraging native SSH config files for details. Don't forget to make sure that your bot server is authorized access to each of the hosts you define. The HOSTNAMES variable shown below should reference hosts defined in your SSH config.

Example configuration

In your environment, define all required variables:

# Path to the Python 3 binary
export PYTHON3_PATH="${APP_DIR}/env3/bin/python3.7"
# Path to the Fabric binary
export FABRIC_PATH="${APP_DIR}/env3/bin/fab"
# Path to where your fabfile is
export FABFILE_PATH='/home/web/fabfile/'

# A list of the commands from your fabfile that should be executable through your Errbot
export ALLOWED_TASKS='
    bootstrap
    deploy
    status
'
# A list of the hosts from your fabfile that you should be able to execute commands against
export HOSTNAMES='
    server_a
    server_b
'

Use

  • Check the status of server_a:
!fab -H server_a status
  • Deploy the result of pulling branch x into the develop branch:
!fab -H server_a branch:develop pull:x deploy

Note that the above executes several commands (branch, pull, deploy) defined in the fabfile.

Caveats

  • Any commands that produce a prompt for addition input are not supported.
  • You can only execute commands against a single host at this time.
  • This plugin was built specifically for use with the Slack backend. Other backends may work, but are not guarenteed.

Inspired by hubot-fabric.

err-fabric's People

Contributors

dolguin- avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

err-fabric'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.