From c8e54b3ecac849eef83460d9cf1ad0d23cfa3d57 Mon Sep 17 00:00:00 2001 From: Jason Olmstead Date: Wed, 14 Dec 2016 16:03:40 -0800 Subject: [PATCH 01/12] 0.1.1 --- package.json | 2 +- src/github.js | 5 +++-- src/versioning.js | 17 +++++++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 src/versioning.js diff --git a/package.json b/package.json index 1b9e6a3..f9d5d8e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "build-bot", - "version": "0.1.0", + "version": "0.1.1", "description": "Bot that can Build, Deploy, and Whistle", "main": "index.js", "scripts": { diff --git a/src/github.js b/src/github.js index 27ab5e3..6390cc6 100644 --- a/src/github.js +++ b/src/github.js @@ -142,5 +142,6 @@ function checkProxy(params){ //** TEST CODE ****/ -Github.push('test-bot-branch', "Testing skip ci"); -// Github.release("0.0.1", "[skip ci]"); +//Github.push('test-bot-branch', "Testing skip ci"); +//Github.mergeToMaster('test-bot-branch'); +//Github.release("0.0.2", "[skip ci]"); diff --git a/src/versioning.js b/src/versioning.js new file mode 100644 index 0000000..9f28b18 --- /dev/null +++ b/src/versioning.js @@ -0,0 +1,17 @@ +var rp = require('request-promise'), + Promise = require('bluebird'), + sh = require('shelljs'); + + +var Versioning = { + update : function(type){ + + } +}; + +module.exports = Versioning; + + +//** TEST CODE ****/ +//Versioning.update(); + From 6d3fe8d5ade988c1ec4211d44904f8f5b06c9001 Mon Sep 17 00:00:00 2001 From: Jason Olmstead Date: Wed, 14 Dec 2016 16:03:48 -0800 Subject: [PATCH 02/12] 0.2.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f9d5d8e..b4626a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "build-bot", - "version": "0.1.1", + "version": "0.2.0", "description": "Bot that can Build, Deploy, and Whistle", "main": "index.js", "scripts": { From ef3da974c4e866e1a26595475417fab4e1ef2401 Mon Sep 17 00:00:00 2001 From: Jason Olmstead Date: Wed, 14 Dec 2016 16:12:43 -0800 Subject: [PATCH 03/12] 1.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b4626a4..01ccb57 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "build-bot", - "version": "0.2.0", + "version": "1.0.0", "description": "Bot that can Build, Deploy, and Whistle", "main": "index.js", "scripts": { From 027844d66b5cf868d873b72deacd6d80fc9fce54 Mon Sep 17 00:00:00 2001 From: Jason Olmstead Date: Wed, 14 Dec 2016 16:15:02 -0800 Subject: [PATCH 04/12] 2.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 01ccb57..630d192 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "build-bot", - "version": "1.0.0", + "version": "2.0.0", "description": "Bot that can Build, Deploy, and Whistle", "main": "index.js", "scripts": { From 955ecc609ad05b5b15a0d73d80a5d67dd6de3702 Mon Sep 17 00:00:00 2001 From: Jason Olmstead Date: Wed, 14 Dec 2016 16:15:49 -0800 Subject: [PATCH 05/12] 1.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 630d192..01ccb57 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "build-bot", - "version": "2.0.0", + "version": "1.0.0", "description": "Bot that can Build, Deploy, and Whistle", "main": "index.js", "scripts": { From e6f7d61b3a15393293a01a7069e38d9222cc46ff Mon Sep 17 00:00:00 2001 From: Jason Olmstead Date: Wed, 14 Dec 2016 16:18:42 -0800 Subject: [PATCH 06/12] auto commit from bot: Testing skip ci --- package.json | 2 +- src/github.js | 14 +++++++------- src/versioning.js | 16 ++++++++++++++-- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 01ccb57..8749cc9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "build-bot", - "version": "1.0.0", + "version": "0.0.1", "description": "Bot that can Build, Deploy, and Whistle", "main": "index.js", "scripts": { diff --git a/src/github.js b/src/github.js index 6390cc6..107a6f6 100644 --- a/src/github.js +++ b/src/github.js @@ -16,16 +16,16 @@ var Github = { if (!branch){ return Promise.reject("No branch name on push"); } - var code = sh.exec('git add .'); - if (code == 1){ + var result = sh.exec('git add .'); + if (result.code == 1){ return Promise.reject("Error on git add"); } - code = sh.exec('git commit -m "auto commit from bot: ' + message + '"'); - if (code == 1){ + result = sh.exec('git commit -m "auto commit from bot: ' + message + '"'); + if (result.code == 1){ return Promise.reject("Error on git commit"); } - code = sh.exec('git push origin ' + branch); - if (code == 1){ + result = sh.exec('git push origin ' + branch); + if (result.code == 1){ return Promise.reject("Error on git push"); } return Promise.resolve(); @@ -142,6 +142,6 @@ function checkProxy(params){ //** TEST CODE ****/ -//Github.push('test-bot-branch', "Testing skip ci"); +Github.push('test-bot-branch', "Testing skip ci"); //Github.mergeToMaster('test-bot-branch'); //Github.release("0.0.2", "[skip ci]"); diff --git a/src/versioning.js b/src/versioning.js index 9f28b18..093ea6e 100644 --- a/src/versioning.js +++ b/src/versioning.js @@ -2,10 +2,22 @@ var rp = require('request-promise'), Promise = require('bluebird'), sh = require('shelljs'); +const PATCH = "patch"; +const MAJOR = "major"; +const MINOR = "minor"; var Versioning = { update : function(type){ - + if (type != PATCH && type != MAJOR && type != MINOR){ + throw new Error("Not valid verstion update type"); + } + var result = sh.exec("npm version " + type + " --force"); + console.log(result); + if (result.code == 1){ + throw new Error("Error updating version"); + } + var version = result.stdout.replace('\n', "").replace("v", ""); + return version; } }; @@ -13,5 +25,5 @@ module.exports = Versioning; //** TEST CODE ****/ -//Versioning.update(); +console.log(Versioning.update("major")); From 479dbd77cc9145524e6a800389799d40d83f2013 Mon Sep 17 00:00:00 2001 From: Jason Olmstead Date: Wed, 14 Dec 2016 16:22:54 -0800 Subject: [PATCH 07/12] 0.0.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8749cc9..3239d57 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "build-bot", - "version": "0.0.1", + "version": "0.0.2", "description": "Bot that can Build, Deploy, and Whistle", "main": "index.js", "scripts": { From b9506559476de5630a032de75132ff581e138578 Mon Sep 17 00:00:00 2001 From: Jason Olmstead Date: Wed, 14 Dec 2016 16:23:04 -0800 Subject: [PATCH 08/12] 0.0.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3239d57..b3e1e3a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "build-bot", - "version": "0.0.2", + "version": "0.0.3", "description": "Bot that can Build, Deploy, and Whistle", "main": "index.js", "scripts": { From b9ab4bc96be471e3e68f90ea155928c4a634c368 Mon Sep 17 00:00:00 2001 From: Jason Olmstead Date: Wed, 14 Dec 2016 16:24:06 -0800 Subject: [PATCH 09/12] 0.0.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b3e1e3a..0332457 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "build-bot", - "version": "0.0.3", + "version": "0.0.4", "description": "Bot that can Build, Deploy, and Whistle", "main": "index.js", "scripts": { From 793353fde00a299b7a9a91a8b3341c91bcb635d9 Mon Sep 17 00:00:00 2001 From: Jason Olmstead Date: Wed, 14 Dec 2016 16:24:36 -0800 Subject: [PATCH 10/12] adding versioning call --- src/versioning.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/versioning.js b/src/versioning.js index 093ea6e..1a7d045 100644 --- a/src/versioning.js +++ b/src/versioning.js @@ -8,15 +8,15 @@ const MINOR = "minor"; var Versioning = { update : function(type){ - if (type != PATCH && type != MAJOR && type != MINOR){ + if (type != PATCH && type != MAJOR && type != MINOR) { throw new Error("Not valid verstion update type"); } - var result = sh.exec("npm version " + type + " --force"); - console.log(result); + var result = sh.exec("npm version " + type + " --force", {silent : true}); if (result.code == 1){ throw new Error("Error updating version"); } var version = result.stdout.replace('\n', "").replace("v", ""); + console.log("Updated to version: v" + version); return version; } }; @@ -25,5 +25,6 @@ module.exports = Versioning; //** TEST CODE ****/ -console.log(Versioning.update("major")); - +//console.log(Versioning.update("patch")); +//console.log(Versioning.update("minor")); +//console.log(Versioning.update("major")); From fb2bc07505b2b89878c15947d74e48dc6d0c6e00 Mon Sep 17 00:00:00 2001 From: Jason Olmstead Date: Wed, 14 Dec 2016 16:26:48 -0800 Subject: [PATCH 11/12] 0.0.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0332457..31aa029 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "build-bot", - "version": "0.0.4", + "version": "0.0.5", "description": "Bot that can Build, Deploy, and Whistle", "main": "index.js", "scripts": { From 2ab0fc2ed3876301da205a2490f4ece645cca742 Mon Sep 17 00:00:00 2001 From: Jason Olmstead Date: Wed, 14 Dec 2016 16:27:20 -0800 Subject: [PATCH 12/12] auto commit from bot: Testing flow with version update --- src/github.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/github.js b/src/github.js index 107a6f6..f340ae1 100644 --- a/src/github.js +++ b/src/github.js @@ -142,6 +142,7 @@ function checkProxy(params){ //** TEST CODE ****/ -Github.push('test-bot-branch', "Testing skip ci"); +//Github.preCheck('test-bot-branch'); +Github.push('test-bot-branch', "Testing flow with version update"); //Github.mergeToMaster('test-bot-branch'); //Github.release("0.0.2", "[skip ci]");