From a953a8a82bb92ffb140f72d58ea91586c3508f7a Mon Sep 17 00:00:00 2001 From: yuta0801 Date: Fri, 22 Dec 2017 05:05:05 +0900 Subject: [PATCH 1/2] Return http status code before deployTasks completes --- index.js | 6 +++--- lib/deployTasks.js | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 8f88b68..e5fad86 100644 --- a/index.js +++ b/index.js @@ -31,9 +31,9 @@ getConfig(function (config) { console.log('Valid payload! Running commands'); - deployTasks.run(function () { - res.status(200).send(); - }); + res.status(200).send(); + + deployTasks.run(); } else { // if other branches were updated, send 200 only to make github happy... diff --git a/lib/deployTasks.js b/lib/deployTasks.js index 28d94d2..23c2344 100644 --- a/lib/deployTasks.js +++ b/lib/deployTasks.js @@ -34,7 +34,7 @@ var async = require('async'), } } - deployTasks.run = function (cb) { + deployTasks.run = function () { if (!initConfigCalled) { throw new Error('You should call initConfig first'); } @@ -45,8 +45,7 @@ var async = require('async'), deployTasks.commandFactory(stopCmd), deployTasks.commandFactory(updateCmd), deployTasks.commandFactory(postUpdateCmd), - deployTasks.commandFactory(startCmd), - cb + deployTasks.commandFactory(startCmd) ]); }; })(); From 98f7782bf287dc75d672887de65a962009815ff1 Mon Sep 17 00:00:00 2001 From: yuta0801 Date: Fri, 22 Dec 2017 05:05:13 +0900 Subject: [PATCH 2/2] 0.2.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 00e527c..a2722d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "github-webhooks-listener", - "version": "0.2.0", + "version": "0.2.1", "description": "A module to listen to github hooks and to update and deploy project when push event occurs", "main": "index.js", "scripts": {