From 805ba85ff3008bfcb6e146eddfd1d3ba9c5fd21b Mon Sep 17 00:00:00 2001 From: Scisco Date: Thu, 17 Jul 2014 13:06:18 -0400 Subject: If the repo is private, ssh key is needed, if it's public a simple https request is enough --- config.sample.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'config.sample.json') diff --git a/config.sample.json b/config.sample.json index 1ad82cf..dee6f1b 100644 --- a/config.sample.json +++ b/config.sample.json @@ -1,18 +1,18 @@ { "gh_server": "github.com", "temp": "/home/ubuntu/jekyll-hook", + "public-repo": True, "scripts": { "build": "./scripts/build.sh", "publish": "./scripts/publish.sh" }, "email": { - "user": "", - "password": "", - "host": "", + "user": "", + "password": "", + "host": "", "ssl": true }, "accounts": [ "developmentseed", - "mapbox" ] -} \ No newline at end of file +} -- cgit v1.2.3 From f4a6440b71d58db09c800c20b6bde4f8a7a275e2 Mon Sep 17 00:00:00 2001 From: Scisco Date: Thu, 17 Jul 2014 13:09:05 -0400 Subject: Added an activate key for the email in config and code --- config.sample.json | 3 ++- jekyll-hook.js | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) (limited to 'config.sample.json') diff --git a/config.sample.json b/config.sample.json index dee6f1b..9b5c601 100644 --- a/config.sample.json +++ b/config.sample.json @@ -1,12 +1,13 @@ { "gh_server": "github.com", "temp": "/home/ubuntu/jekyll-hook", - "public-repo": True, + "public-repo": true, "scripts": { "build": "./scripts/build.sh", "publish": "./scripts/publish.sh" }, "email": { + "isActivated": false, "user": "", "password": "", "host": "", diff --git a/jekyll-hook.js b/jekyll-hook.js index 32359e2..80db6fd 100755 --- a/jekyll-hook.js +++ b/jekyll-hook.js @@ -112,13 +112,15 @@ function run(file, params, cb) { } function send(body, subject, data) { - if (config.email && data.pusher.email) { - var message = { - text: body, - from: config.email.user, - to: data.pusher.email, - subject: subject - }; - mailer.send(message, function(err) { if (err) console.warn(err); }); + if (config.email.isActivated) { + if (config.email && data.pusher.email) { + var message = { + text: body, + from: config.email.user, + to: data.pusher.email, + subject: subject + }; + mailer.send(message, function(err) { if (err) console.warn(err); }); + } } } -- cgit v1.2.3 From 38f970c6d3086bc7a5fa76722c12ba563fa38f95 Mon Sep 17 00:00:00 2001 From: Scisco Date: Thu, 17 Jul 2014 14:02:08 -0400 Subject: omitted an extra comma --- config.sample.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config.sample.json') diff --git a/config.sample.json b/config.sample.json index 9b5c601..59a4c41 100644 --- a/config.sample.json +++ b/config.sample.json @@ -14,6 +14,6 @@ "ssl": true }, "accounts": [ - "developmentseed", + "developmentseed" ] } -- cgit v1.2.3 From 6b1c513513d20eb68d78299b0d19fb404d10014c Mon Sep 17 00:00:00 2001 From: Scisco Date: Thu, 17 Jul 2014 14:04:34 -0400 Subject: Fixed issue with config item naming --- config.sample.json | 2 +- jekyll-hook.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'config.sample.json') diff --git a/config.sample.json b/config.sample.json index 59a4c41..01da368 100644 --- a/config.sample.json +++ b/config.sample.json @@ -1,7 +1,7 @@ { "gh_server": "github.com", "temp": "/home/ubuntu/jekyll-hook", - "public-repo": true, + "public_repo": true, "scripts": { "build": "./scripts/build.sh", "publish": "./scripts/publish.sh" diff --git a/jekyll-hook.js b/jekyll-hook.js index 80db6fd..a5d61fa 100755 --- a/jekyll-hook.js +++ b/jekyll-hook.js @@ -49,7 +49,7 @@ app.post('/hooks/jekyll/:branch', function(req, res) { /* owner */ params.push(data.owner); /* giturl */ - if (config.public-repo) { + if (config.public_repo) { params.push('https://' + config.gh_server + '/' + data.owner + '/' + data.repo + '.git'); } else { params.push('git@' + config.gh_server + ':' + data.owner + '/' + data.repo + '.git'); -- cgit v1.2.3