Compare commits

...

6 Commits

Author SHA1 Message Date
adfdf68c38 3.1.35 2019-07-17 17:55:03 +02:00
d4a4d69941 fix(core): update 2019-07-17 17:55:02 +02:00
c1fed2c758 3.1.34 2019-07-17 17:04:10 +02:00
9918d81f59 fix(core): update 2019-07-17 17:04:10 +02:00
59d8338f6e 3.1.33 2019-06-19 14:00:24 +02:00
a4f8bd3320 fix(core): update 2019-06-19 14:00:24 +02:00
7 changed files with 1011 additions and 522 deletions

View File

@@ -1,5 +1,5 @@
# gitzone ci_default # gitzone ci_default
image: hosttoday/ht-docker-node:npmci image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache: cache:
paths: paths:
@@ -49,23 +49,11 @@ testLTS:
tags: tags:
- docker - docker
- notpriv - notpriv
testSTABLE:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
release: release:
stage: release stage: release
script: script:
- npmci node install stable - npmci node install lts
- npmci npm publish - npmci npm publish
only: only:
- tags - tags

1444
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "@shipzone/npmci", "name": "@shipzone/npmci",
"version": "3.1.32", "version": "3.1.35",
"private": false, "private": false,
"description": "node and docker in gitlab ci on steroids", "description": "node and docker in gitlab ci on steroids",
"main": "dist/index.js", "main": "dist/index.js",
@@ -40,6 +40,7 @@
"@pushrocks/smartcli": "^3.0.7", "@pushrocks/smartcli": "^3.0.7",
"@pushrocks/smartdelay": "^2.0.3", "@pushrocks/smartdelay": "^2.0.3",
"@pushrocks/smartfile": "^7.0.2", "@pushrocks/smartfile": "^7.0.2",
"@pushrocks/smartgit": "^1.0.9",
"@pushrocks/smartlog": "^2.0.19", "@pushrocks/smartlog": "^2.0.19",
"@pushrocks/smartlog-destination-local": "^8.0.2", "@pushrocks/smartlog-destination-local": "^8.0.2",
"@pushrocks/smartparam": "^1.0.4", "@pushrocks/smartparam": "^1.0.4",

View File

@@ -114,7 +114,10 @@ export const push = async argvArg => {
dockerRegistryUrls.push(argvArg._[2]); dockerRegistryUrls.push(argvArg._[2]);
} else { } else {
if (configObject.dockerRegistries.length === 0) { if (configObject.dockerRegistries.length === 0) {
logger.log('warn', `There are no docker registries listed in npmextra.json! This is strange!`); logger.log(
'warn',
`There are no docker registries listed in npmextra.json! This is strange!`
);
} }
dockerRegistryUrls = dockerRegistryUrls.concat(configObject.dockerRegistries); dockerRegistryUrls = dockerRegistryUrls.concat(configObject.dockerRegistries);
} }

View File

@@ -41,6 +41,9 @@ export let mirror = async () => {
if (githubToken) { if (githubToken) {
logger.log('info', 'found github token.'); logger.log('info', 'found github token.');
logger.log('info', 'attempting the mirror the repository to GitHub'); logger.log('info', 'attempting the mirror the repository to GitHub');
plugins.smartgit.GitRepo
// add the mirror // add the mirror
await bash( await bash(
`git remote add mirror https://${githubToken}@github.com/${githubUser}/${githubRepo}.git` `git remote add mirror https://${githubToken}@github.com/${githubUser}/${githubRepo}.git`

View File

@@ -1 +1,7 @@
export * from '../npmci.plugins'; export * from '../npmci.plugins';
import * as smartgit from '@pushrocks/smartgit';
export {
smartgit
};

View File

@@ -66,25 +66,45 @@ const prepare = async () => {
* publish a package to npm * publish a package to npm
*/ */
const publish = async () => { const publish = async () => {
let npmAccessCliString = ``; const buildPublishCommand = async () => {
let npmRegistryCliString = ``; let npmAccessCliString = ``;
const config = await configModule.getConfig(); let npmRegistryCliString = ``;
let publishVerdaccioAsWell = false;
const config = await configModule.getConfig();
const availableRegistries: string[] = [];
await plugins.smartparam.forEachMinimatch(process.env, 'NPMCI_TOKEN_NPM*', npmEnvArg => {
availableRegistries.push(npmEnvArg.split('|')[0]);
});
// -> configure package access level // -> configure package access level
if ( if (
config.npmAccessLevel && config.npmAccessLevel
(config.npmAccessLevel === 'public' || config.npmAccessLevel === 'private') ) {
) { npmAccessCliString = `--access=${config.npmAccessLevel}`;
npmAccessCliString = `--access=${config.npmAccessLevel}`; if (config.npmAccessLevel === 'public') {
} publishVerdaccioAsWell = true;
}
}
// -> configure registry url
if (config.npmRegistryUrl) {
npmRegistryCliString = `--registry=https://${config.npmRegistryUrl}`;
} else {
logger.log('error', `no registry url specified. Can't publish!`);
process.exit(1);
}
// -> configure registry url let publishCommand = `npm publish ${npmAccessCliString} ${npmRegistryCliString} `;
if (config.npmRegistryUrl) {
npmRegistryCliString = `--registry=https://${config.npmRegistryUrl}`; // publishEverywhere
} else { if (publishVerdaccioAsWell) {
logger.log('error', `no registry url specified. Can't publish!`); const verdaccioRegistry = availableRegistries.find(registryString => registryString.startsWith('verdaccio'));
process.exit(1); if (verdaccioRegistry) {
} logger.log('info', `package is public and verdaccio registry is specified. Also publishing to Verdaccio!`);
publishCommand = `${publishCommand} && npm publish ${npmAccessCliString} --registry=https://${verdaccioRegistry}`;
}
}
return publishCommand;
};
// -> preparing // -> preparing
logger.log('info', `now preparing environment:`); logger.log('info', `now preparing environment:`);
@@ -105,7 +125,7 @@ const publish = async () => {
// -> publish it // -> publish it
logger.log('info', `now invoking npm to publish the package!`); logger.log('info', `now invoking npm to publish the package!`);
await bash(`npm publish ${npmAccessCliString} ${npmRegistryCliString}`); await bash(await buildPublishCommand());
logger.log('success', `Package was successfully published!`); logger.log('success', `Package was successfully published!`);
}; };