Coder Social home page Coder Social logo

capitoshka's Introduction

Capitoshka Build Status

Simple web API in front of capistrano that translates requests into cap commands.

Installation

Clone repository:

git clone git://github.com/yevgenko/capitoshka.git

Grab dependencies:

bundle install

Copy capistrano recipes or entire projects as subfolder under .projects directory, e.g.: .projects/foo-bar where foo-bar is a particular project.

Alternatively you can create new recipes as usually with capistrano:

mkdir -p .projects/new-foo-bar
cd .projects/new-foo-bar
capify .

NOTE: the .projects directory can be anywhere on the same server, but defaults to the current path, see Usage section.

Usage

bundle exec ruby app.rb

By default capistrano recipes must be located in .projects directory, but you can change that with CAP_PROJECTS_PATH environment variable, e.g.:

CAP_PROJECTS_PATH="/home/my/.projects" bundle exec ruby app.rb

API

List projects

GET /projects

Response

{
    "projects": [
        {
            "name": "a"
        },
        {
            "name": "cap-foobar"
        },
        {
            "name": "b"
        }
    ]
}

Execute cap command

POST /projects/:name/cap

Input

  • name, required string - The name of project/directory where specific recipes persists;
  • args, required array - The command-line parameters to pass to cap command.

Example:

{
    "args":["deploy:check"]
}

Response

{
    "ok"
}

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

capitoshka's People

Contributors

yevgenko avatar

Watchers

 avatar

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.