Skip to content
This repository was archived by the owner on Apr 7, 2018. It is now read-only.

oleduc/ferrymang

Repository files navigation

Ferrymang

A simple github deployment tool. This project goal was mostly to learn more about the github API, use at your own risk.

Installation

Requirements:

Usage

usage: ferrymang.py [-h] --pubkpath PUBKPATH --prvkpath PRVKPATH --pkpasswd PKPASSWD --signature SIGNATURE [--giturl GITURL] [--ip IP] [--port PORT]

  • signature : The github token as configured in your repository settings pages
  • pubkpath : The path to your public ssh key
  • prvkpath : The path to your private ssh key
  • pkpasswd : The password to decrypt your ssh key
  • giturl : The url of the repository which will be used to download your ferrymang.json configuration file if the cached version is unavailable for any reason.

Configuration

Supported variables:

  • {branch} : Branch name
  • {path} : Path of the current application
  • {random} : A random variable [*]

Example:

{
  "root": "/var/applications/",
  "applications": {
      "app-one": {
          "path": "./app-one-{branch}/",
          "main": true,
          "start": {
              "commands": [
                  "npm install",
                  "forever start --uid \"api-{branch}\" {path}/app.js"
              ],
          },
          "stop": {
              "path": "./stop.sh",
              "parameters": "{branch}"
          }
      },
      "app-two":{
          "path": "./app-two-server/",
          "main": false,
          "start": {
              "path": "./start.sh",
              "parameters": "{branch} arg2 {path} etc"
          },
          "stop": {
              "command": "forever stop --uid app-two {path}/app.js",
              "parameters": "{branch}"
          }
      }
  },
  "actions" : [
      {
          "type": "move",
          "from": "./some-cloned-folder-relative-to-repo-root/config/*",
          "to"  : "./some-folder-relative-to-configured-root/config/"
      },
      {
          "type": "delete",
          "path": "./some-folder-relative-to-configured-root/config/"
      },
      {
          "type": "mkdir",
          "path": "./some-folder-relative-to-configured-root/config/"
      },
      {
          "type": "move",
          "from": "./home/config/example",
          "to"  : "./app-two/config.json"
      }
  ]
}

Features

  • Listen to github push events
  • Clone one or multiple git repositories
  • Parse a list of actions (JSON) and execute it
  • Execute start/stop scripts

Todo

  • Database deployment
  • Multiple repositories

About

A simple git deploy tool.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published