improve triggr detection

This commit is contained in:
Philipp Kunz 2016-06-23 22:22:03 +02:00
parent 3e80ea15e0
commit 3298b6298e
13 changed files with 84 additions and 63 deletions

File diff suppressed because one or more lines are too long

6
dist/npmci.env.js vendored
View File

@ -22,7 +22,7 @@ exports.configStore = function () {
var configLoad = function () {
// internal config to transfer information in between npmci shell calls
try {
exports.config = plugins.smartfile.local.toObjectSync(paths.NpmciPackageConfig, "json");
exports.config = plugins.smartfile.fs.toObjectSync(paths.NpmciPackageConfig, "json");
}
catch (err) {
exports.config = {};
@ -32,7 +32,7 @@ var configLoad = function () {
// project config
try {
if (!exports.config.project) {
exports.config.project = plugins.smartfile.local.toObjectSync(paths.NpmciProjectDir, "npmci.json");
exports.config.project = plugins.smartfile.fs.toObjectSync(paths.NpmciProjectDir, "npmci.json");
plugins.beautylog.ok("project config found!");
}
;
@ -46,4 +46,4 @@ var configLoad = function () {
};
configLoad();
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLmVudi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBQ3hCLElBQVksT0FBTyxXQUFNLGlCQUFpQixDQUFDLENBQUE7QUFDM0MsSUFBWSxLQUFLLFdBQU0sZUFBZSxDQUFDLENBQUE7QUFDdkMsNEJBQXNCLGFBQWEsQ0FBQyxDQUFBO0FBSXBDLEVBQUUsQ0FBQSxDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsYUFBYSxDQUFDO0lBQUMsWUFBSSxHQUFHLElBQUkscUJBQU8sQ0FBQyxPQUFPLENBQUMsR0FBRyxDQUFDLGFBQWEsQ0FBQyxDQUFDO0FBRWpFLGtCQUFVLEdBQVUsT0FBTyxDQUFDLEdBQUcsQ0FBQyxjQUFjLENBQUM7QUFJL0Msd0JBQWdCLEdBQWdCLEVBQUUsQ0FBQztBQUNuQyxtQkFBV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0U3luYyhwYXRocy5OcG1jaVBhY2thZ2VDb25maWcsXCJqc29uXCIpO1xuICAgIH1cbiAgICBjYXRjaChlcnIpe1xuICAgICAgICBjb25maWcgPSB7fTtcbiAgICAgICAgY29uZmlnU3RvcmUoKTtcbiAgICAgICAgcGx1Z2lucy5iZWF1dHlsb2cubG9nKFwiY29uZmlnIGluaXRpYWxpemVkIVwiKTtcbiAgICB9XG5cbiAgICAvLyBwcm9qZWN0IGNvbmZpZ1xuICAgIHRyeSB7XG4gICAgICAgIGlmKCFjb25maWcucHJvamVjdCl7XG4gICAgICAgICAgICBjb25maWcucHJvamVjdCA9IHBsdWdpbnMuc21hcnRmaWxlLmxvY2FsLnRvT2JqZWN0U3luYyhwYXRocy5OcG1jaVByb2plY3REaXIsXCJucG1jaS5qc29uXCIpO1xuICAgICAgICAgICAgcGx1Z2lucy5iZWF1dHlsb2cub2soXCJwcm9qZWN0IGNvbmZpZyBmb3VuZCFcIik7XG4gICAgICAgIH07XG4gICAgfVxuICAgIGNhdGNoKGVycil7XG4gICAgICAgIGNvbmZpZy5wcm9qZWN0ID0ge307XG4gICAgICAgIHBsdWdpbnMuYmVhdXR5bG9nLmxvZyhcIm5vIHByb2plY3QgY29uZmlnIGZvdW5kLCBzbyBwcm9jZWVkaW5nIHdpdGggZGVmYXVsdCBiZWhhdmlvdXIhXCIpO1xuICAgIH1cbiAgICBcbiAgICBjb25maWcuZG9ja2VyUmVnaXN0cnkgPyBkb2NrZXJSZWdpc3RyeSA9IGNvbmZpZy5kb2NrZXJSZWdpc3RyeSA6IHZvaWQoMCk7XG4gICAgY29uZmlnLmRvY2tlckZpbGVzQnVpbHQgPyBkb2NrZXJGaWxlc0J1aWx0ID0gY29uZmlnLmRvY2tlckZpbGVzQnVpbHQgOiB2b2lkKDApO1xufVxuY29uZmlnTG9hZCgpOyJdfQ==
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLmVudi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xuICAgICAgICBkb2NrZXJGaWxlczogZG9ja2VyRmlsZXNcbiAgICB9XG4gICAgcGx1Z2lucy5zbWFydGZpbGUubWVtb3J5LnRvRnNTeW5jKFxuICAgICAgICBKU09OLnN0cmluZ2lmeShjb25maWcpLFxuICAgICAgICB7XG4gICAgICAgICAgICBmaWxlTmFtZTpcImNvbmZpZy5qc29uXCIsXG4gICAgICAgICAgICBmaWxlUGF0aDpwYXRocy5OcG1jaVBhY2thZ2VSb290XG4gICAgICAgIH1cbiAgICApO1xufVxuXG5sZXQgY29uZmlnTG9hZCA9ICgpID0+IHtcbiAgICAvLyBpbnRlcm5hbCBjb25maWcgdG8gdHJhbnNmZXIgaW5mb3JtYXRpb24gaW4gYmV0d2VlbiBucG1jaSBzaGVsbCBjYWxsc1xuICAgIHRyeSB7XG4gICAgICAgIGNvbmZpZyA9IHBsdWdpbnMuc21hcnRmaWxlLmZzLnRvT2JqZWN0U3luYyhwYXRocy5OcG1jaVBhY2thZ2VDb25maWcsXCJqc29uXCIpO1xuICAgIH1cbiAgICBjYXRjaChlcnIpe1xuICAgICAgICBjb25maWcgPSB7fTtcbiAgICAgICAgY29uZmlnU3RvcmUoKTtcbiAgICAgICAgcGx1Z2lucy5iZWF1dHlsb2cubG9nKFwiY29uZmlnIGluaXRpYWxpemVkIVwiKTtcbiAgICB9XG5cbiAgICAvLyBwcm9qZWN0IGNvbmZpZ1xuICAgIHRyeSB7XG4gICAgICAgIGlmKCFjb25maWcucHJvamVjdCl7XG4gICAgICAgICAgICBjb25maWcucHJvamVjdCA9IHBsdWdpbnMuc21hcnRmaWxlLmZzLnRvT2JqZWN0U3luYyhwYXRocy5OcG1jaVByb2plY3REaXIsXCJucG1jaS5qc29uXCIpO1xuICAgICAgICAgICAgcGx1Z2lucy5iZWF1dHlsb2cub2soXCJwcm9qZWN0IGNvbmZpZyBmb3VuZCFcIik7XG4gICAgICAgIH07XG4gICAgfVxuICAgIGNhdGNoKGVycil7XG4gICAgICAgIGNvbmZpZy5wcm9qZWN0ID0ge307XG4gICAgICAgIHBsdWdpbnMuYmVhdXR5bG9nLmxvZyhcIm5vIHByb2plY3QgY29uZmlnIGZvdW5kLCBzbyBwcm9jZWVkaW5nIHdpdGggZGVmYXVsdCBiZWhhdmlvdXIhXCIpO1xuICAgIH1cbiAgICBcbiAgICBjb25maWcuZG9ja2VyUmVnaXN0cnkgPyBkb2NrZXJSZWdpc3RyeSA9IGNvbmZpZy5kb2NrZXJSZWdpc3RyeSA6IHZvaWQoMCk7XG4gICAgY29uZmlnLmRvY2tlckZpbGVzQnVpbHQgPyBkb2NrZXJGaWxlc0J1aWx0ID0gY29uZmlnLmRvY2tlckZpbGVzQnVpbHQgOiB2b2lkKDApO1xufVxuY29uZmlnTG9hZCgpOyJdfQ==

View File

@ -8,7 +8,8 @@ export import projectinfo = require("projectinfo");
export declare let q: any;
export declare let request: any;
export declare let shelljs: any;
export import smartfile = require("smartfile");
export import smartparam = require("smartparam");
export import smartssh = require("smartssh");
export import smartstring = require("smartstring");
export import smartfile = require("smartfile");
export declare let through2: any;

View File

@ -9,9 +9,10 @@ exports.projectinfo = require("projectinfo");
exports.q = require("q");
exports.request = require("request");
exports.shelljs = require("shelljs");
exports.smartfile = require("smartfile");
exports.smartparam = require("smartparam");
exports.smartssh = require("smartssh");
exports.smartstring = require("smartstring");
exports.smartfile = require("smartfile");
exports.through2 = require("through2");
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUNWLGlCQUFTLFdBQVcsV0FBVyxDQUFDLENBQUM7QUFDcEMsaUJBQVMsR0FBRyxPQUFPLENBQUMsV0FBVyxDQUFDLENBQUM7QUFDakMsWUFBSSxHQUFHLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FBQztBQUN2Qixv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DIgPSByZXF1aXJlKFwidGhyb3VnaDJcIik7Il19

3
dist/npmci.ssh.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
import "typings-global";
export declare let ssh: () => void;
export declare let evaluateSshkey: () => void;

11
dist/npmci.ssh.js vendored Normal file
View File

@ -0,0 +1,11 @@
"use strict";
require("typings-global");
var plugins = require("./npmci.plugins");
exports.ssh = function () {
var sshInstance = new plugins.smartssh.SshInstance();
plugins.smartparam.forEachMinimatch(process.env, "NPMCI_SSHKEY_*", exports.evaluateSshkey);
};
exports.evaluateSshkey = function () {
};
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLnNzaC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBQ3hCLElBQVksT0FBTyxXQUFNLGlCQUFpQixDQUFDLENBQUE7QUFFaEMsV0FBRyxHQUFHO0lBQ2IsSUFBSSxXQUFXLEdBQUcsSUFBSSxPQUFPLENBQUMsUUFBUSxDQUFDLFdBQVcsRUFBRSxDQUFDO0lBQ3JELE9BQU8sQ0FBQyxVQUFVLENBQUMsZ0JBQWdCLENBQUMsT0FBTyxDQUFDLEdBQUcsRUFBQyxnQkFBZ0IsRUFBQyxzQkFBYyxDQUFDLENBQUM7QUFDckYsQ0FBQyxDQUFDO0FBRVMsc0JBQWMsR0FBRztBQUU1QixDQUFDLENBQUMiLCJmaWxlIjoibnBtY2kuc3NoLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFwidHlwaW5ncy1nbG9iYWxcIjtcbmltcG9ydCAqIGFzIHBsdWdpbnMgZnJvbSBcIi4vbnBtY2kucGx1Z2luc1wiO1xuXG5leHBvcnQgbGV0IHNzaCA9ICgpID0+IHtcbiAgICBsZXQgc3NoSW5zdGFuY2UgPSBuZXcgcGx1Z2lucy5zbWFydHNzaC5Tc2hJbnN0YW5jZSgpO1xuICAgIHBsdWdpbnMuc21hcnRwYXJhbS5mb3JFYWNoTWluaW1hdGNoKHByb2Nlc3MuZW52LFwiTlBNQ0lfU1NIS0VZXypcIixldmFsdWF0ZVNzaGtleSk7XG59O1xuXG5leHBvcnQgbGV0IGV2YWx1YXRlU3Noa2V5ID0gKCkgPT4ge1xuICAgIFxufTsiXX0=

45
dist/npmci.trigger.js vendored
View File

@ -1,35 +1,30 @@
"use strict";
require("typings-global");
var plugins = require("./npmci.plugins");
//Variables
var triggerEnvPrefix = "NPMCI_TRIGGER_";
var triggerValueRegex = /^([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)\|?([a-zA-Z0-9\.\-\/]*)/;
exports.trigger = function () {
var done = plugins.q.defer();
plugins.beautylog.info("now running triggers");
var triggerRegex = /^([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)\|?([a-zA-Z0-9\.\-\/]*)/;
for (var i = 0; i < 100; i++) {
var iteratorString = i.toString();
var triggerName = triggerEnvPrefix + iteratorString;
if (process.env[triggerName]) {
var triggerRegexResultArray = triggerRegex.exec(process.env[triggerName]);
var regexDomain = triggerRegexResultArray[1];
var regexProjectId = triggerRegexResultArray[2];
var regexProjectTriggerToken = triggerRegexResultArray[3];
var regexRefName = triggerRegexResultArray[4];
var regexTriggerName = void 0;
if (triggerRegexResultArray.length == 6) {
regexTriggerName = triggerRegexResultArray[5];
}
else {
regexTriggerName = "Unnamed Trigger";
}
plugins.beautylog.info("Found " + triggerName);
plugins.beautylog.log("triggering build for ref " + regexRefName + " of " + regexTriggerName);
plugins.request.post("https://gitlab.com/api/v3/projects/" + regexProjectId + "/trigger/builds", { form: { token: regexProjectTriggerToken, ref: regexRefName } });
}
}
plugins.smartparam.forEachMinimatch(process.env, "NPMCI_TRIGGER_*", evaluateTrigger);
done.resolve();
return done.promise;
};
var evaluateTrigger = function (triggerEnvVarArg) {
var triggerRegexResultArray = triggerValueRegex.exec(triggerEnvVarArg);
var regexDomain = triggerRegexResultArray[1];
var regexProjectId = triggerRegexResultArray[2];
var regexProjectTriggerToken = triggerRegexResultArray[3];
var regexRefName = triggerRegexResultArray[4];
var regexTriggerName;
if (triggerRegexResultArray.length == 6) {
regexTriggerName = triggerRegexResultArray[5];
}
else {
regexTriggerName = "Unnamed Trigger";
}
plugins.beautylog.info("Found Trigger!");
plugins.beautylog.log("triggering build for ref " + regexRefName + " of " + regexTriggerName);
plugins.request.post("https://gitlab.com/api/v3/projects/" + regexProjectId + "/trigger/builds", { form: { token: regexProjectTriggerToken, ref: regexRefName } });
};
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLnRyaWdnZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUN4QixJQUFZLE9BQU8sV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBSTNDLFdBQVc7QUFDWCxJQUFJLGdCQUFnQixHQUFHLGdCQUFnQixDQUFDO0FBRTdCLGVBQU8sR0FBRztJQUNqQixJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFDO0lBQzdCLE9BQU8sQ0FBQyxTQUFTLENBQUMsSUFBSSxDQUFDLHNCQUFzQixDQUFDLENBQUM7SUFDL0MsSUFBSSxZQUFZLEdBQUcsZ0dBQWdHLENBQUM7SUFDcEgsR0FBRyxDQUFBLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsR0FBRyxHQUFHLEVBQUUsQ0FBQyxFQUFFLEVBQUMsQ0FBQztRQUN6QixJQUFJLGNBQWMsR0FBRyxDQUFDLENBQUMsUUFBUSxFQUFFLENBQUM7UUFDbEMsSUFBSSxXQUFXLEdB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V4UHJvamVjdFRyaWdnZXJUb2tlbiA9IHRyaWdnZXJSZWdleFJlc3VsdEFycmF5WzNdO1xuICAgIGxldCByZWdleFJlZk5hbWUgPSB0cmlnZ2VyUmVnZXhSZXN1bHRBcnJheVs0XTtcbiAgICBsZXQgcmVnZXhUcmlnZ2VyTmFtZTtcbiAgICBpZiAodHJpZ2dlclJlZ2V4UmVzdWx0QXJyYXkubGVuZ3RoID09IDYpIHtcbiAgICAgICAgcmVnZXhUcmlnZ2VyTmFtZSA9IHRyaWdnZXJSZWdleFJlc3VsdEFycmF5WzVdO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIHJlZ2V4VHJpZ2dlck5hbWUgPSBcIlVubmFtZWQgVHJpZ2dlclwiO1xuICAgIH1cbiAgICBwbHVnaW5zLmJlYXV0eWxvZy5pbmZvKFwiRm91bmQgVHJpZ2dlciFcIik7XG4gICAgcGx1Z2lucy5iZWF1dHlsb2cubG9nKFwidHJpZ2dlcmluZyBidWlsZCBmb3IgcmVmIFwiICsgcmVnZXhSZWZOYW1lICsgXCIgb2YgXCIgKyByZWdleFRyaWdnZXJOYW1lKTtcbiAgICBwbHVnaW5zLnJlcXVlc3QucG9zdChcImh0dHBzOi8vZ2l0bGFiLmNvbS9hcGkvdjMvcHJvamVjdHMvXCIgKyByZWdleFByb2plY3RJZCArIFwiL3RyaWdnZXIvYnVpbGRzXCIsIHsgZm9ybTogeyB0b2tlbjogcmVnZXhQcm9qZWN0VHJpZ2dlclRva2VuLCByZWY6IHJlZ2V4UmVmTmFtZSB9IH0pO1xufSJdfQ==

View File

@ -34,6 +34,7 @@
"request": "^2.72.0",
"shelljs": "^0.7.0",
"smartfile": "^4.0.4",
"smartparam": "^0.1.1",
"smartssh": "^1.0.6",
"smartstring": "^2.0.10",
"through2": "^2.0.1",

View File

@ -133,7 +133,7 @@ export class Dockerfile {
this.releaseTag = dockerTag(NpmciEnv.dockerRegistry,this.repo,this.version);
this.containerName = "dockerfile-" + this.version;
if(options.filePath && options.read){
this.content = plugins.smartfile.local.toStringSync(plugins.path.resolve(options.filePath));
this.content = plugins.smartfile.fs.toStringSync(plugins.path.resolve(options.filePath));
};
this.baseImage = dockerBaseImage(this.content);
this.localBaseImageDependent = false;
@ -170,7 +170,7 @@ export class Dockerfile {
};
test(){
let testFile:string = plugins.path.join(paths.NpmciTestDir,"test_" + this.version + ".sh");
let testFileExists:boolean = plugins.smartfile.checks.fileExistsSync(testFile);
let testFileExists:boolean = plugins.smartfile.fs.fileExistsSync(testFile);
if(testFileExists){
bashBare("docker run --name npmci_test_container " + this.buildTag + " mkdir /npmci_test");
bashBare("docker cp " + testFile + " npmci_test_container:/npmci_test/test.sh");

View File

@ -33,7 +33,7 @@ export let configStore = () => {
let configLoad = () => {
// internal config to transfer information in between npmci shell calls
try {
config = plugins.smartfile.local.toObjectSync(paths.NpmciPackageConfig,"json");
config = plugins.smartfile.fs.toObjectSync(paths.NpmciPackageConfig,"json");
}
catch(err){
config = {};
@ -44,7 +44,7 @@ let configLoad = () => {
// project config
try {
if(!config.project){
config.project = plugins.smartfile.local.toObjectSync(paths.NpmciProjectDir,"npmci.json");
config.project = plugins.smartfile.fs.toObjectSync(paths.NpmciProjectDir,"npmci.json");
plugins.beautylog.ok("project config found!");
};
}

View File

@ -8,7 +8,8 @@ export import projectinfo = require("projectinfo");
export let q = require("q");
export let request = require("request");
export let shelljs = require("shelljs");
export import smartfile = require("smartfile");
export import smartparam = require("smartparam");
export import smartssh = require("smartssh");
export import smartstring = require("smartstring");
export import smartfile = require("smartfile");
export let through2 = require("through2");

11
ts/npmci.ssh.ts Normal file
View File

@ -0,0 +1,11 @@
import "typings-global";
import * as plugins from "./npmci.plugins";
export let ssh = () => {
let sshInstance = new plugins.smartssh.SshInstance();
plugins.smartparam.forEachMinimatch(process.env,"NPMCI_SSHKEY_*",evaluateSshkey);
};
export let evaluateSshkey = () => {
};

View File

@ -3,33 +3,30 @@ import * as plugins from "./npmci.plugins";
import {prepare} from "./npmci.prepare";
import {bash} from "./npmci.bash";
//Variables
let triggerEnvPrefix = "NPMCI_TRIGGER_";
export let trigger = function(){
let triggerValueRegex = /^([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)\|?([a-zA-Z0-9\.\-\/]*)/;
export let trigger = function () {
let done = plugins.q.defer();
plugins.beautylog.info("now running triggers");
let triggerRegex = /^([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)\|?([a-zA-Z0-9\.\-\/]*)/;
for(let i = 0; i < 100; i++){
let iteratorString = i.toString();
let triggerName = triggerEnvPrefix + iteratorString
if(process.env[triggerName]){
let triggerRegexResultArray = triggerRegex.exec(process.env[triggerName]);
let regexDomain = triggerRegexResultArray[1];
let regexProjectId = triggerRegexResultArray[2];
let regexProjectTriggerToken = triggerRegexResultArray[3];
let regexRefName = triggerRegexResultArray[4];
let regexTriggerName;
if(triggerRegexResultArray.length == 6){
regexTriggerName = triggerRegexResultArray[5];
} else {
regexTriggerName = "Unnamed Trigger";
}
plugins.beautylog.info("Found " + triggerName);
plugins.beautylog.log("triggering build for ref " + regexRefName + " of " + regexTriggerName);
plugins.request.post("https://gitlab.com/api/v3/projects/" + regexProjectId + "/trigger/builds", {form:{token:regexProjectTriggerToken,ref:regexRefName}});
}
}
plugins.smartparam.forEachMinimatch(process.env, "NPMCI_TRIGGER_*", evaluateTrigger);
done.resolve();
return done.promise;
}
let evaluateTrigger = (triggerEnvVarArg) => {
let triggerRegexResultArray = triggerValueRegex.exec(triggerEnvVarArg);
let regexDomain = triggerRegexResultArray[1];
let regexProjectId = triggerRegexResultArray[2];
let regexProjectTriggerToken = triggerRegexResultArray[3];
let regexRefName = triggerRegexResultArray[4];
let regexTriggerName;
if (triggerRegexResultArray.length == 6) {
regexTriggerName = triggerRegexResultArray[5];
} else {
regexTriggerName = "Unnamed Trigger";
}
plugins.beautylog.info("Found Trigger!");
plugins.beautylog.log("triggering build for ref " + regexRefName + " of " + regexTriggerName);
plugins.request.post("https://gitlab.com/api/v3/projects/" + regexProjectId + "/trigger/builds", { form: { token: regexProjectTriggerToken, ref: regexRefName } });
}