diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-08-10 11:01:29 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-08-10 11:01:38 +0100 |
commit | d0c22665a7a4ddbe2af447a5daf28d51c734ae6a (patch) | |
tree | c20198f58a0cea1a710a5116b06896a3f44af270 /lib/gitano/actions.lua | |
parent | 07cb69c35349fddcc4645754f28adc3218080de0 (diff) | |
download | gitano-d0c22665a7a4ddbe2af447a5daf28d51c734ae6a.tar.gz |
GITANO: Switch all current hooks (update, post-receive) to use Supple
Diffstat (limited to 'lib/gitano/actions.lua')
-rw-r--r-- | lib/gitano/actions.lua | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/gitano/actions.lua b/lib/gitano/actions.lua index 3de1001..f565305 100644 --- a/lib/gitano/actions.lua +++ b/lib/gitano/actions.lua @@ -10,6 +10,7 @@ local log = require "gitano.log" local git = require "gitano.git" local config = require "gitano.config" local sio = require 'luxio.simple' +local supple = require 'gitano.supple' local function update_actions(conf, repo, tags) @@ -226,6 +227,7 @@ local function send_to_cia(msg) end local function cia_inform_commits(project, branch, repo, previoustip, newtip) + repo = supple.unproxy_repo(repo) log.ddebug("Attempting CIA report for", branch, "in", project) log.ddebug("Previous tip was", previoustip, "new tip is", newtip) log.ddebug("Generating messages...") @@ -266,7 +268,25 @@ local function set_hook_globals(config, repo, globs) globs["cia"] = { inform_commits = cia_inform_commits } end +local function set_supple_globals(action) + local globs = {} + local logcopy = {} + + for _, k in pairs({ "state", "crit", "critical", "err", "error", "warn", + "warning", "chat", "info", "debug", "ddebug", + "deepdebug" }) do + logcopy[k] = log[k] + end + globs["log"] = logcopy + if action == "post-receive" then + globs["http_get"] = http_get + globs["cia"] = { inform_commits = cia_inform_commits } + end + supple.set_globals(globs) +end + return { update_actions = update_actions, set_hook_globals = set_hook_globals, + set_supple_globals = set_supple_globals, } |