Permalink
Browse files

Added GitHub webhook build trigger.

  • Loading branch information...
jacobstr committed Feb 23, 2013
1 parent 9bba964 commit 5eeaf7579714a8855d0967be0ff53aabc890b982
Showing with 107 additions and 47 deletions.
  1. +7 −0 README.md
  2. +1 −1 lib/concrete.js
  3. +24 −7 lib/git.js
  4. +1 −1 lib/jobs.js
  5. +1 −1 lib/logger.js
  6. +1 −1 lib/public/concrete.js
  7. +1 −1 lib/public/stats.js
  8. +1 −1 lib/runner.js
  9. +29 −16 lib/server.js
  10. +1 −1 lib/stats.js
  11. +17 −4 src/git.coffee
  12. +23 −13 src/server.coffee
View
@@ -28,6 +28,13 @@ Concrete is a minimalistic Continuous Integration server.
## Setting the branch
git config --add concrete.branch deploy
+## Configuring GitHub Webhook
+You can have builds trigger automatically whenever a commit is pushed to GitHub
+via Webhooks. See your :repo:/settings/hooks and add the WebHook URL `/webhook`.
+
+You may configure the url via:
+ git config --add concrete.webhook '/webhook'
+
## Adding HTTP Basic authentication
git config --add concrete.user username
git config --add concrete.pass password
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -17,6 +17,7 @@ git = module.exports =
branch: 'concrete.branch'
user: 'concrete.user'
pass: 'concrete.pass'
+ webhook: 'concrete.webhook'
# init at target directory
init: (target, callback) ->
@@ -44,6 +45,7 @@ git = module.exports =
process.exit 1
getUser()
getPass()
+ getWebhook()
getBranch()
getRunner()
@@ -78,19 +80,30 @@ git = module.exports =
addNote: (sha, message) ->
exec "git notes --ref=ci add -f -m \"#{message}\" #{sha}", (err,stdo,stderr) =>
#swallow
+
+readStdout = (stdout) ->
+ stdout.toString().replace /[\s\r\n]+$/, ''
+
getUser = ->
exec 'git config --get ' + git.config.user, (error, stdout, stderr)=>
if error?
git.user = ''
else
- git.user = stdout.toString().replace /[\s\r\n]+$/, ''
+ git.user = readStdout stdout
getPass = ->
exec 'git config --get ' + git.config.pass, (error, stdout, stderr)=>
if error?
git.pass = ''
else
- git.pass = stdout.toString().replace /[\s\r\n]+$/, ''
+ git.pass = readStdout stdout
+
+getWebhook = ->
+ exec 'git config --get ' + git.config.webhook, (error, stdout, stderr)=>
+ if error?
+ git.webhook = '/webhook'
+ else
+ git.webhook = readStdout stdout
# get the current working branch
# fallback to master if git.config.branch isn't set
@@ -100,7 +113,7 @@ getBranch = ->
git.branch = 'master'
gitContinue()
else
- git.branch = stdout.toString().replace /[\s\r\n]+$/, ''
+ git.branch = readStdout stdout
git.branch = 'master' if git.branch is ''
gitContinue()
@@ -111,7 +124,7 @@ getRunner = ->
console.log "Git.getRunner: #{error}".red
process.exit 1
else
- git.runner = stdout.toString().replace /[\s\r\n]+$/, ''
+ git.runner = readStdout stdout
git.runner = 'none' if git.runner is ''
gitContinue()
Oops, something went wrong.

0 comments on commit 5eeaf75

Please sign in to comment.