update ssh module

This commit is contained in:
2017-06-15 15:46:08 +02:00
parent 419db8b197
commit 9f2e629e8f
16 changed files with 54 additions and 110 deletions

View File

@ -1,8 +1,7 @@
import * as plugins from './mod.plugins'
import { bash } from '../npmci.bash'
import * as env from '../npmci.env'
import * as sshModule from '../npmci.ssh'
import * as npmciMods from '../npmci.mods'
// types
@ -59,6 +58,7 @@ let dockerGitlab = async () => {
* prepare ssh
*/
let ssh = async () => {
let sshModule = await npmciMods.modSsh.load()
await sshModule.ssh()
}

View File

@ -1,4 +1,4 @@
import * as plugins from './npmci.plugins'
import * as plugins from './mod.plugins'
let sshRegex = /^(.*)\|(.*)\|(.*)/
let sshInstance: plugins.smartssh.SshInstance
@ -20,11 +20,11 @@ export let ssh = async () => {
sshInstance.writeToDisk()
} else {
plugins.beautylog.log('In test mode, so not storing SSH keys to disk!')
};
}
}
/**
* gets called for each found SSH ENV Var and deploys it
* gets called for each found SSH ENV Var and deploys it
*/
let evaluateSshEnv = async (sshkeyEnvVarArg) => {
let resultArray = sshRegex.exec(sshkeyEnvVarArg)
@ -37,11 +37,11 @@ let evaluateSshEnv = async (sshkeyEnvVarArg) => {
if (notUndefined(resultArray[2])) {
plugins.beautylog.log('---> privKey defined!')
sshKey.privKeyBase64 = resultArray[2]
};
}
if (notUndefined(resultArray[3])) {
'---> pubKey defined!'
plugins.beautylog.log('---> pubKey defined!')
sshKey.pubKeyBase64 = resultArray[3]
};
}
sshInstance.addKey(sshKey)
return

View File

@ -0,0 +1 @@
export * from '../npmci.plugins'

View File

@ -6,6 +6,7 @@ import * as _modInstall from './mod_install/index'
import * as _modPublish from './mod_publish/index'
import * as _modPurge from './mod_purge/index'
import * as _modPrepare from './mod_prepare/index'
import * as _modSsh from './mod_ssh/index'
import * as _modTrigger from './mod_trigger/index'
import * as _modTest from './mod_test/index'
@ -19,5 +20,6 @@ export let modInstall = new LazyModule<typeof _modInstall>('./mod_install/index'
export let modPublish = new LazyModule<typeof _modPublish>('./mod_publish/index', __dirname)
export let modPurge = new LazyModule<typeof _modPurge>('./mod_purge/index', __dirname)
export let modPrepare = new LazyModule<typeof _modPrepare>('./mod_prepare/index', __dirname)
export let modSsh = new LazyModule<typeof _modSsh>('./mod_ssh/index', __dirname)
export let modTrigger = new LazyModule<typeof _modTrigger>('./mod_trigger/index', __dirname)
export let modTest = new LazyModule<typeof _modTest>('./mod_test/index',__dirname)