Go modular

This commit is contained in:
PhilKunz External
2017-05-18 20:40:09 +00:00
committed by Phil Kunz
parent 6edd51c6e6
commit b6a85319b0
64 changed files with 454 additions and 316 deletions

32
ts/mod_servezone/index.ts Normal file
View File

@ -0,0 +1,32 @@
import * as plugins from '../npmci.plugins'
/**
* servezoneRegex is the regex that parses the servezone connection data
* parses strings in the form of "servezone.example.com|3000|somepassword"
*/
let servezoneRegex = /^(.*)\|(.*)\|(.*)/
/**
* holds the results of the parsed servezone env string
*/
let servezoneRegexResultArray = servezoneRegex.exec(process.env.NPMCI_SERVEZONE)
/**
* the data object that is used for the smartsocket client object
*/
let smartsocketClientConstructorOptions = {
alias: 'npmci',
password: servezoneRegexResultArray[3],
port: parseInt(servezoneRegexResultArray[2]),
role: 'ci',
url: servezoneRegexResultArray[1]
}
/**
* the main run function to submit a service to a servezone
*/
export let run = async (configArg) => {
new plugins.smartsocket.SmartsocketClient(
smartsocketClientConstructorOptions
)
}