tang

command module
v0.0.0-...-035f922 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2015 License: BSD-2-Clause Imports: 28 Imported by: 0

README

Tang is on ice

We stopped developing tang, sorry. It remains here for posterity.

Tang

Ancanthurus leucosternon

Tang installs itself as a github service hook, then listens. It does stuff when you push to github.com. Add a tang.hook file to your repo and tang will run it when pushed, lighting up your github repos with red, green, and amber lights.

When deployed at Scraperwiki, its available on services.scraperwiki.com.

go is required.

Running tang

The source code for tang must be installed in a place where go install can find it, probably underneath your GOPATH. I have a symlink made like this:

mkdir -p $GOPATH/src/github.com
ln -s ~/sw $GOPATH/src/github.com/scraperwiki

Docker must be installed and a docker container for tang must be built:

docker build -t tang .

A master script will build tang, install it, and run it in a docker container (building and installing tang is quick enough that we do it most of the time):

# Set GITHUB_USER and GITHUB_PASSWORD
. ./github-password.sh
sudo ./start-tang

Building, Installing, Testing

go build            # builds

./install-tang      # builds and installs

go test             # tests

tang                # runs tang
sudo -E ./tang      # runs tang as root
./tang --help       # lists options

Principles of Operation

tang listens (on port 8080 by default, but we expect this to be fronted by nginx or similar).

It responds to various signals and conditions (typical of most Unix daemons):

  • SIGQUIT - quits.
  • SIGINT and SIGHUP - restart by reloading the executable.
  • EOF (on stdin) - quits an interactive tang.

The URLs tang responds to are:

  • /hook - for handling calls from github.com (checks out repo and runs tang.hook).

  • /tang/logs - serve the log directory

  • /tang - for experimentation and testing

URLs in the domain qa.scraperwiki.com are routed to a server built by a repos' tang.serve script (if the repo has one). The tang.serve script will be run on demand in a docker container that tang creates.

[<params>].<branch>.<repo-name>.qa.scraperwiki.com will route to the tag <branch> on the repo scraperwiki/<repo-name>. <params> is optional and will be made available to the server for it to use as configuration parameters.

Roadmap

  • ✓ On git push, update a local clone, if tang.hook exists check it out and invoke tang.hook.
  • ✓ (for now) Only run for 'allowed pushers'
  • ✓ Tang runs inside a docker container
  • tang-event script for synthesizing github events
  • Have an interface for "starting" and "stopping"
  • Provide a persistent data volume (assume we can trust tang.hook for now, later we can have auth by repository)
  • Tang runs tang.hook inside docker containers
Credits

Image by H. Zell used under GFDL: http://en.wikipedia.org/wiki/File:Acanthurus_leucosternon_01.JPG

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL