fix(core): update

This commit is contained in:
Philipp Kunz 2019-08-29 20:38:44 +02:00
parent 6dd537fe43
commit 6337b20d62
12 changed files with 39 additions and 39 deletions

View File

@ -1,7 +1,5 @@
# gitzone ci_default # gitzone ci_default
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
variables:
GIT_STRATEGY: clone
cache: cache:
paths: paths:
@ -102,7 +100,7 @@ trigger:
pages: pages:
image: hosttoday/ht-docker-dbase:npmci image: hosttoday/ht-docker-dbase:npmci
services: services:
- docker:18-dind - docker:stable-dind
stage: metadata stage: metadata
script: script:
- npmci command npm install -g @gitzone/tsdoc - npmci command npm install -g @gitzone/tsdoc

View File

@ -29,28 +29,34 @@ let sortableArray: npmci.Dockerfile[];
tap.test('should return valid Dockerfiles', async () => { tap.test('should return valid Dockerfiles', async () => {
const npmciInstance = new npmci.Npmci(); const npmciInstance = new npmci.Npmci();
dockerfile1 = new npmci.Dockerfile(npmciInstance.dockerManager, { filePath: './Dockerfile', read: true }); dockerfile1 = new npmci.Dockerfile(npmciInstance.dockerManager, {
dockerfile2 = new npmci.Dockerfile(npmciInstance.dockerManager, { filePath: './Dockerfile_sometag1', read: true }); filePath: './Dockerfile',
read: true
});
dockerfile2 = new npmci.Dockerfile(npmciInstance.dockerManager, {
filePath: './Dockerfile_sometag1',
read: true
});
expect(dockerfile1.version).to.equal('latest'); expect(dockerfile1.version).to.equal('latest');
return expect(dockerfile2.version).to.equal('sometag1'); return expect(dockerfile2.version).to.equal('sometag1');
}); });
tap.test('should read a directory of Dockerfiles', async () => { tap.test('should read a directory of Dockerfiles', async () => {
const npmciInstance = new npmci.Npmci(); const npmciInstance = new npmci.Npmci();
return npmci.Dockerfile return npmci.Dockerfile.readDockerfiles(npmciInstance.dockerManager).then(
.readDockerfiles(npmciInstance.dockerManager) async (readDockerfilesArrayArg: npmci.Dockerfile[]) => {
.then(async (readDockerfilesArrayArg: npmci.Dockerfile[]) => {
sortableArray = readDockerfilesArrayArg; sortableArray = readDockerfilesArrayArg;
return expect(readDockerfilesArrayArg[1].version).to.equal('sometag1'); return expect(readDockerfilesArrayArg[1].version).to.equal('sometag1');
}); }
);
}); });
tap.test('should sort an array of Dockerfiles', async () => { tap.test('should sort an array of Dockerfiles', async () => {
return npmci.Dockerfile return npmci.Dockerfile.sortDockerfiles(sortableArray).then(
.sortDockerfiles(sortableArray) async (sortedArrayArg: npmci.Dockerfile[]) => {
.then(async (sortedArrayArg: npmci.Dockerfile[]) => {
console.log(sortedArrayArg); console.log(sortedArrayArg);
}); }
);
}); });
tap.test('should build all Dockerfiles', async () => { tap.test('should build all Dockerfiles', async () => {

View File

@ -4,5 +4,5 @@ import * as plugins from '../npmci.plugins';
* *
*/ */
export class CloudlyConnector { export class CloudlyConnector {
public announceDockerContainer(options: plugins.servezoneInterfaces.IVersionData) {}
} }

View File

@ -50,7 +50,7 @@ export class NpmciDockerManager {
`>>npmci docker ...<< cli arguments invalid... Please read the documentation.` `>>npmci docker ...<< cli arguments invalid... Please read the documentation.`
); );
} }
} };
/** /**
* builds a cwd of Dockerfiles by triggering a promisechain * builds a cwd of Dockerfiles by triggering a promisechain
@ -62,7 +62,7 @@ export class NpmciDockerManager {
.then(Dockerfile.sortDockerfiles) .then(Dockerfile.sortDockerfiles)
.then(Dockerfile.mapDockerfiles) .then(Dockerfile.mapDockerfiles)
.then(Dockerfile.buildDockerfiles); .then(Dockerfile.buildDockerfiles);
} };
/** /**
* login to the DockerRegistries * login to the DockerRegistries
@ -70,7 +70,7 @@ export class NpmciDockerManager {
public login = async () => { public login = async () => {
await this.prepare(); await this.prepare();
await this.npmciRegistryStorage.loginAll(); await this.npmciRegistryStorage.loginAll();
} };
/** /**
* logs in docker * logs in docker
@ -98,7 +98,7 @@ export class NpmciDockerManager {
} }
); );
return; return;
} };
/** /**
* pushes an image towards a registry * pushes an image towards a registry
@ -146,7 +146,7 @@ export class NpmciDockerManager {
await dockerfile.push(dockerRegistryToPushTo, suffix); await dockerfile.push(dockerRegistryToPushTo, suffix);
} }
} }
} };
/** /**
* pulls an image * pulls an image
@ -165,7 +165,7 @@ export class NpmciDockerManager {
for (const dockerfile of dockerfileArray) { for (const dockerfile of dockerfileArray) {
await dockerfile.pull(localDockerRegistry, suffix); await dockerfile.pull(localDockerRegistry, suffix);
} }
} };
/** /**
* tests docker files * tests docker files
@ -173,5 +173,5 @@ export class NpmciDockerManager {
public test = async () => { public test = async () => {
await this.prepare(); await this.prepare();
return await Dockerfile.readDockerfiles(this).then(Dockerfile.testDockerfiles); return await Dockerfile.readDockerfiles(this).then(Dockerfile.testDockerfiles);
} };
} }

View File

@ -3,4 +3,3 @@ import * as plugins from './mod.plugins';
import * as paths from '../npmci.paths'; import * as paths from '../npmci.paths';
import { Dockerfile } from './mod.classes.dockerfile'; import { Dockerfile } from './mod.classes.dockerfile';

View File

@ -27,7 +27,7 @@ export class NpmciGitManager {
} else { } else {
logger.log('info', `npmci git -> cli arguments invalid! Please read the documentation.`); logger.log('info', `npmci git -> cli arguments invalid! Please read the documentation.`);
} }
} };
public mirror = async () => { public mirror = async () => {
const githubToken = process.env.NPMCI_GIT_GITHUBTOKEN; const githubToken = process.env.NPMCI_GIT_GITHUBTOKEN;
@ -61,5 +61,5 @@ export class NpmciGitManager {
logger.log('error', `cannot find NPMCI_GIT_GITHUBTOKEN env var!`); logger.log('error', `cannot find NPMCI_GIT_GITHUBTOKEN env var!`);
process.exit(1); process.exit(1);
} }
} };
} }

View File

@ -106,5 +106,5 @@ export class NpmciCli {
public startParse = () => { public startParse = () => {
this.smartcli.startParse(); this.smartcli.startParse();
} };
} }

View File

@ -51,7 +51,7 @@ export class NpmciConfig {
logger logger
); );
this.configObject = { this.configObject = {
projectInfo: new plugins.projectinfo.ProjectInfo(paths.cwd), projectInfo: new plugins.projectinfo.ProjectInfo(paths.cwd),
npmGlobalTools: [], npmGlobalTools: [],
dockerRegistries: [], dockerRegistries: [],

View File

@ -1,10 +1,9 @@
import * as plugins from './npmci.plugins'; import * as plugins from './npmci.plugins';
import * as paths from './npmci.paths'; import * as paths from './npmci.paths';
import { logger } from "./npmci.logging"; import { logger } from './npmci.logging';
import { Npmci } from './npmci.classes.npmci'; import { Npmci } from './npmci.classes.npmci';
export class NpmciInfo { export class NpmciInfo {
public npmciRef: Npmci; public npmciRef: Npmci;
public projectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.NpmciPackageRoot); public projectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.NpmciPackageRoot);
@ -12,7 +11,7 @@ export class NpmciInfo {
this.npmciRef = npmciArg; this.npmciRef = npmciArg;
} }
public printToConsole () { public printToConsole() {
logger.log('info', `npmci version: ${this.projectInfo.version}`); logger.log('info', `npmci version: ${this.projectInfo.version}`);
} }
} }

View File

@ -6,9 +6,7 @@ export { path };
// @servezone // @servezone
import * as servezoneInterfaces from '@servezone/servezone-interfaces'; import * as servezoneInterfaces from '@servezone/servezone-interfaces';
export { export { servezoneInterfaces };
servezoneInterfaces
};
// @pushrocks // @pushrocks
import * as npmextra from '@pushrocks/npmextra'; import * as npmextra from '@pushrocks/npmextra';