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

View File

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

View File

@ -4,5 +4,5 @@ import * as plugins from '../npmci.plugins';
*
*/
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.`
);
}
}
};
/**
* builds a cwd of Dockerfiles by triggering a promisechain
@ -62,7 +62,7 @@ export class NpmciDockerManager {
.then(Dockerfile.sortDockerfiles)
.then(Dockerfile.mapDockerfiles)
.then(Dockerfile.buildDockerfiles);
}
};
/**
* login to the DockerRegistries
@ -70,7 +70,7 @@ export class NpmciDockerManager {
public login = async () => {
await this.prepare();
await this.npmciRegistryStorage.loginAll();
}
};
/**
* logs in docker
@ -98,7 +98,7 @@ export class NpmciDockerManager {
}
);
return;
}
};
/**
* pushes an image towards a registry
@ -146,7 +146,7 @@ export class NpmciDockerManager {
await dockerfile.push(dockerRegistryToPushTo, suffix);
}
}
}
};
/**
* pulls an image
@ -165,7 +165,7 @@ export class NpmciDockerManager {
for (const dockerfile of dockerfileArray) {
await dockerfile.pull(localDockerRegistry, suffix);
}
}
};
/**
* tests docker files
@ -173,5 +173,5 @@ export class NpmciDockerManager {
public test = async () => {
await this.prepare();
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 { Dockerfile } from './mod.classes.dockerfile';

View File

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

View File

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

View File

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

View File

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