run triggers

This commit is contained in:
Philipp Kunz 2016-06-01 06:30:21 +02:00
parent aafa5bd1e9
commit 3a6e2d6f3d
2 changed files with 21 additions and 1 deletions

View File

@ -9,6 +9,7 @@ plugins.beautylog.info("npmci version: " + packJson.version);
import {install} from "./npmci.install"; import {install} from "./npmci.install";
import {test} from "./npmci.test"; import {test} from "./npmci.test";
import {publish} from "./npmci.publish"; import {publish} from "./npmci.publish";
import {trigger} from "./npmci.trigger";
let command; let command;
@ -39,7 +40,8 @@ switch (command){
break; break;
case "publish": case "publish":
publish(commandOption); publish(commandOption)
.then(trigger);
break; break;
default: default:
break; break;

18
ts/npmci.trigger.ts Normal file
View File

@ -0,0 +1,18 @@
import "typings-global";
import * as plugins from "./npmci.plugins";
import {prepare} from "./npmci.prepare";
import {bash} from "./npmci.bash";
export let trigger = function(){
let done = plugins.q.defer();
plugins.beautylog.info("now running triggers");
for(let i = 0; i < 100; i++){
let iteratorString = i.toString();
if(process.env["TRIGGER" + iteratorString]){
plugins.beautylog.log("Found TRIGGER" + iteratorString);
bash("curl -X POST " + process.env["TRIGGER" + iteratorString]);
}
}
done.resolve();
return done.promise;
}