re-added code to read/write websocket data. added to amber templates

This commit is contained in:
Brad
2014-06-08 23:59:23 -07:00
parent b0255af7a9
commit 4d4defc416
11 changed files with 64 additions and 41 deletions

View File

@@ -85,15 +85,15 @@ func (w *worker) execute(task *BuildTask) error {
// make sure a channel exists for the repository,
// the commit, and the commit output (TODO)
reposlug := fmt.Sprintf("%s/%s/%s", task.Repo.Host, task.Repo.Owner, task.Repo.Name)
commitslug := fmt.Sprintf("%s/%s/%s/commit/%s/%s", task.Repo.Host, task.Repo.Owner, task.Repo.Name, task.Commit.Branch, task.Commit.Sha)
consoleslug := fmt.Sprintf("%s/%s/%s/commit/%s/%s/console", task.Repo.Host, task.Repo.Owner, task.Repo.Name, task.Commit.Branch, task.Commit.Sha)
//commitslug := fmt.Sprintf("%s/%s/%s/%s/%s", task.Repo.Host, task.Repo.Owner, task.Repo.Name, task.Commit.Branch, task.Commit.Sha)
consoleslug := fmt.Sprintf("%s/%s/%s/%s/%s", task.Repo.Host, task.Repo.Owner, task.Repo.Name, task.Commit.Branch, task.Commit.Sha)
channel.Create(reposlug)
channel.Create(commitslug)
//channel.Create(commitslug)
channel.CreateStream(consoleslug)
// notify the channels that the commit and build started
channel.SendJSON(reposlug, task.Commit)
channel.SendJSON(commitslug, task.Commit)
//channel.SendJSON(commitslug, task.Commit)
var buf = &bufferWrapper{channel: consoleslug}
@@ -145,7 +145,7 @@ func (w *worker) execute(task *BuildTask) error {
// notify the channels that the commit and build finished
channel.SendJSON(reposlug, task.Commit)
channel.SendJSON(commitslug, task.Commit)
//channel.SendJSON(commitslug, task.Commit)
channel.Close(consoleslug)
// send all "finished" notifications