Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.
/ bitbuckethook Public archive

web server handling POST hooks from bitbucket.org.

Notifications You must be signed in to change notification settings

Doist/bitbuckethook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bitbucket Web Service hook server

A web server handling POST hooks from bitbucket.org.

The idea and code is heavily inspired by http://github.com/derekpitt/githubservicehook

Installation

go install github.com/doist/bitbuckethook

Usage

As you start a hook server, you could define following options

  • -c: configuration file for hook listener commands (see below for format, default value is "bitbuckethook.json" in current directory)
  • -p: port to listen (default is 4007)
  • -t: optional secret token
  • -q: per repository request backlog size (queue)
  • -b: also use branches for command matching; if set, repositories can also be specified as repoName@branchName (can impose security risk if repo has @ in its name)

If you launch the command as

bitbuckethook -p 4007 -c bitbuckethook.json -t foobar

Then your POST hook URL should look like this:

http://yourdomain.tld/?token=foobar

See POST hook management for more details.

Configuration file

The file bitbuckethook.json is used to map repository names to commands to execute. Repository names don't contain user part, commands are lists of strings.

{
    "repo1": ["make", "-C", "/path/to/directory"],
    "repo2": ["bash", "-c", "cd /foo && git pull && sudo service nginx reload"],
}

About

web server handling POST hooks from bitbucket.org.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages