summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.sample.json10
-rwxr-xr-xjekyll-hook.js9
2 files changed, 13 insertions, 6 deletions
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
+}
diff --git a/jekyll-hook.js b/jekyll-hook.js
index 42b505c..32359e2 100755
--- a/jekyll-hook.js
+++ b/jekyll-hook.js
@@ -47,7 +47,14 @@ app.post('/hooks/jekyll/:branch', function(req, res) {
/* repo */ params.push(data.repo);
/* branch */ params.push(data.branch);
/* owner */ params.push(data.owner);
- /* giturl */ params.push('git@' + config.gh_server + ':' + data.owner + '/' + data.repo + '.git');
+
+ /* giturl */
+ 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');
+ }
+
/* source */ params.push(config.temp + '/' + data.owner + '/' + data.repo + '/' + data.branch + '/' + 'code');
/* build */ params.push(config.temp + '/' + data.owner + '/' + data.repo + '/' + data.branch + '/' + 'site');