run triggers
This commit is contained in:
parent
aafa5bd1e9
commit
3a6e2d6f3d
@ -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
18
ts/npmci.trigger.ts
Normal 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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user