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

@ -67,4 +67,4 @@
"npmextra.json",
"readme.md"
]
}
}

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

@ -1,8 +1,8 @@
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;
@ -46,9 +46,9 @@ export class NpmciGitManager {
if (githubToken) {
logger.log('info', 'found github token.');
logger.log('info', 'attempting the mirror the repository to GitHub');
// plugins.smartgit.GitRepo;
// add the mirror
await bash(
`git remote add mirror https://${githubToken}@github.com/${githubUser}/${githubRepo}.git`
@ -61,5 +61,5 @@ export class NpmciGitManager {
logger.log('error', `cannot find NPMCI_GIT_GITHUBTOKEN env var!`);
process.exit(1);
}
}
};
}

View File

@ -52,4 +52,4 @@ export class Npmci {
await this.npmciConfig.init();
this.npmciCli.startParse();
}
}
}

View File

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

View File

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

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';