complete modular transition

This commit is contained in:
2017-05-19 12:09:33 +02:00
parent cf41e81153
commit 7c5cafeb1b
38 changed files with 234 additions and 153 deletions

View File

@ -1,5 +1,5 @@
import * as plugins from './npmci.plugins'
import { bash } from './npmci.bash'
import * as plugins from './mod.plugins'
import { bash } from '../npmci.bash'
export let command = async () => {
let wrappedCommand: string = ''

View File

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

View File

@ -1,10 +1,10 @@
import * as plugins from './npmci.plugins'
import * as configModule from './npmci.config'
import * as plugins from './mod.plugins'
import * as configModule from '../npmci.config'
import {
bash,
bashNoError,
nvmAvailable,
yarnAvailable } from './npmci.bash'
yarnAvailable } from '../npmci.bash'
/**
* Install a specific version of node

View File

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

View File

@ -1,7 +1,7 @@
import * as plugins from './npmci.plugins'
import { bash } from './npmci.bash'
import * as env from './npmci.env'
import * as sshModule from './npmci.ssh'
import * as plugins from './mod.plugins'
import { bash } from '../npmci.bash'
import * as env from '../npmci.env'
import * as sshModule from '../npmci.ssh'
// types

View File

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

View File

@ -1,8 +1,12 @@
import * as plugins from './npmci.plugins'
import { prepare } from './npmci.prepare'
import { bash } from './npmci.bash'
import * as NpmciEnv from './npmci.env'
import * as NpmciBuildDocker from './npmci.build.docker'
import * as plugins from './mod.plugins'
import { bash } from '../npmci.bash'
import * as NpmciEnv from '../npmci.env'
import * as npmciMods from '../npmci.mods'
// import interfaces
import { Dockerfile } from '../mod_docker/index'
/**
* type of supported services
@ -26,20 +30,20 @@ export let publish = async (pubServiceArg: TPubService = 'npm') => {
* tries to publish current cwd to NPM registry
*/
let publishNpm = async () => {
await prepare('npm')
.then(async function () {
await bash('npm publish')
plugins.beautylog.ok('Done!')
})
let modPrepare = await npmciMods.modPrepare.load()
await modPrepare.prepare('npm')
await bash('npm publish')
plugins.beautylog.ok('Done!')
}
/**
* tries to publish current cwd to Docker registry
*/
let publishDocker = async () => {
return await NpmciBuildDocker.readDockerfiles()
.then(NpmciBuildDocker.pullDockerfileImages)
.then(NpmciBuildDocker.pushDockerfiles)
let modDocker = await npmciMods.modDocker.load()
return await modDocker.readDockerfiles()
.then(modDocker.pullDockerfileImages)
.then(modDocker.pushDockerfiles)
.then(dockerfileArray => {
return dockerfileArray
})

View File

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

View File

@ -1,6 +1,5 @@
import * as plugins from './npmci.plugins'
import { prepare } from './npmci.prepare'
import { bash } from './npmci.bash'
import * as plugins from './mod.plugins'
import { bash } from '../npmci.bash'
let triggerValueRegex = /^([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)\|?([a-zA-Z0-9\.\-\/]*)/
@ -23,5 +22,8 @@ let evaluateTrigger = async (triggerEnvVarArg) => {
}
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 } })
plugins.request.post(
'https://gitlab.com/api/v3/projects/' + regexProjectId + '/trigger/builds',
{ form: { token: regexProjectTriggerToken, ref: regexRefName }
})
}

View File

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