Compare commits

...

22 Commits

Author SHA1 Message Date
5133651e34 3.1.27 2019-06-18 17:30:05 +02:00
c8f26c7c48 fix(core): update 2019-06-18 17:30:04 +02:00
3bb5912046 3.1.26 2019-06-18 16:19:07 +02:00
d75258d9dd fix(core): update 2019-06-18 16:19:07 +02:00
b1577e7542 3.1.25 2019-05-08 22:50:57 +02:00
d5cdeffd17 fix(core): update 2019-05-08 22:50:57 +02:00
c62ce415e9 3.1.24 2019-05-08 22:44:34 +02:00
99014da1e8 fix(core): update 2019-05-08 22:44:34 +02:00
0b5dada524 3.1.23 2019-05-08 22:43:49 +02:00
40bddba3b5 fix(core): update 2019-05-08 22:43:48 +02:00
6f6ee6d799 3.1.22 2019-02-24 22:50:12 +01:00
e30cc3f5a0 fix(core): update 2019-02-24 22:50:12 +01:00
a4562d4d1b 3.1.21 2018-12-24 02:13:05 +01:00
524b405773 fix(core): update 2018-12-24 02:13:04 +01:00
0d19c1c68d 3.1.20 2018-12-23 18:57:15 +01:00
cff79bc3b4 fix(mirror): now refusing to mirror for private code 2018-12-23 18:57:15 +01:00
28541a838d 3.1.19 2018-12-23 18:54:17 +01:00
c3ab527341 fix(core): update 2018-12-23 18:54:16 +01:00
52cc249098 3.1.18 2018-12-23 17:29:25 +01:00
2e189b0660 fix(core): update 2018-12-23 17:29:25 +01:00
f876c7414b 3.1.17 2018-12-12 22:29:59 +01:00
08b7585cfc fix(core): update 2018-12-12 22:29:59 +01:00
12 changed files with 1784 additions and 756 deletions

20
.gitignore vendored
View File

@@ -1,7 +1,19 @@
dist/
node_modules/
.nogit/
# artifacts
coverage/
public/
config.json
pages/
# installs
node_modules/
# caches and builds
.yarn/
.npmci_cache
.cache/
dist/
dist_web/
dist_serve/
dist_ts_web/
# custom

View File

@@ -1,16 +1,26 @@
{
"npmts":{
"mode":"default",
"coverageTreshold": "70",
"cli": true
},
"npmci": {
"npmGlobalTools": [],
"npmAccessLevel": "public",
"npmRegistryUrl": "registry.npmjs.org"
},
"npmdocker":{
"baseImage":"hosttoday/ht-docker-node:npmci",
"command": "npmci test stable"
"npmts": {
"mode": "default",
"coverageTreshold": "70",
"cli": true
},
"npmci": {
"npmGlobalTools": [],
"npmAccessLevel": "public",
"npmRegistryUrl": "registry.npmjs.org"
},
"npmdocker": {
"baseImage": "hosttoday/ht-docker-node:npmci",
"command": "npmci test stable"
},
"gitzone": {
"module": {
"githost": "gitlab.com",
"gitscope": "shipzone",
"gitrepo": "npmci",
"shortDescription": "node and docker in gitlab ci on steroids",
"npmPackagename": "@shipzone/npmci",
"license": "MIT"
}
}
}

2361
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,7 @@
{
"name": "@shipzone/npmci",
"version": "3.1.16",
"version": "3.1.27",
"private": false,
"description": "node and docker in gitlab ci on steroids",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
@@ -23,36 +24,33 @@
},
"homepage": "https://gitlab.com/gitzone/npmci#README",
"devDependencies": {
"@gitzone/tsbuild": "^2.0.22",
"@gitzone/tsrun": "^1.1.13",
"@gitzone/tstest": "^1.0.15",
"@pushrocks/tapbundle": "^3.0.7",
"@types/node": "^10.12.10",
"tslint": "^5.11.0",
"tslint-config-prettier": "^1.17.0"
"@gitzone/tsbuild": "^2.1.11",
"@gitzone/tsrun": "^1.2.6",
"@gitzone/tstest": "^1.0.24",
"@pushrocks/tapbundle": "^3.0.9",
"@types/node": "^12.0.8",
"tslint": "^5.17.0",
"tslint-config-prettier": "^1.18.0"
},
"dependencies": {
"@pushrocks/lik": "^3.0.2",
"@pushrocks/npmextra": "^3.0.1",
"@pushrocks/lik": "^3.0.5",
"@pushrocks/npmextra": "^3.0.5",
"@pushrocks/projectinfo": "^4.0.2",
"@pushrocks/smartcli": "^3.0.6",
"@pushrocks/smartdelay": "^2.0.2",
"@pushrocks/smartfile": "^6.0.11",
"@pushrocks/smartlog": "^2.0.9",
"@pushrocks/smartlog-destination-local": "^7.0.5",
"@pushrocks/smartanalytics": "^2.0.15",
"@pushrocks/smartcli": "^3.0.7",
"@pushrocks/smartdelay": "^2.0.3",
"@pushrocks/smartfile": "^7.0.2",
"@pushrocks/smartlog": "^2.0.19",
"@pushrocks/smartlog-destination-local": "^8.0.2",
"@pushrocks/smartparam": "^1.0.4",
"@pushrocks/smartpromise": "^2.0.5",
"@pushrocks/smartrequest": "^1.1.14",
"@pushrocks/smartshell": "^2.0.11",
"@pushrocks/smartpromise": "^3.0.2",
"@pushrocks/smartrequest": "^1.1.16",
"@pushrocks/smartshell": "^2.0.23",
"@pushrocks/smartsocket": "^1.1.38",
"@pushrocks/smartssh": "^1.2.3",
"@pushrocks/smartstring": "^3.0.5",
"@types/lodash": "^4.14.118",
"@types/shelljs": "^0.8.0",
"@pushrocks/smartstring": "^3.0.10",
"@types/shelljs": "^0.8.5",
"@types/through2": "^2.0.34",
"lodash": "^4.17.11",
"smartanalytics": "^2.0.9",
"smartsocket": "^1.1.19",
"through2": "^3.0.0"
},
"private": false
"through2": "^3.0.1"
}
}

View File

@@ -1,25 +1,20 @@
# npmci
# @shipzone/npmci
node and docker in gitlab ci on steroids
## Availabililty
[![npm](https://shipzone.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/@shipzone/npmci)
[![git](https://shipzone.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/shipzone/npmci)
[![git](https://shipzone.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/shipzone/npmci)
[![docs](https://shipzone.gitlab.io/assets/repo-button-docs.svg)](https://shipzone.gitlab.io/npmci/)
## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@shipzone/npmci)
* [gitlab.com (source)](https://gitlab.com/shipzone/npmci)
* [github.com (source mirror)](https://github.com/shipzone/npmci)
* [docs (typedoc)](https://shipzone.gitlab.io/npmci/)
## Status for master
[![build status](https://GitLab.com/shipzone/npmci/badges/master/build.svg)](https://GitLab.com/shipzone/npmci/commits/master)
[![coverage report](https://GitLab.com/shipzone/npmci/badges/master/coverage.svg)](https://GitLab.com/shipzone/npmci/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/npmci.svg)](https://www.npmjs.com/package/@shipzone/npmci)
[![Dependency Status](https://david-dm.org/shipzone/npmci.svg)](https://david-dm.org/shipzone/npmci)
[![bitHound Dependencies](https://www.bithound.io/github/shipzone/npmci/badges/dependencies.svg)](https://www.bithound.io/github/shipzone/npmci/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/shipzone/npmci/badges/code.svg)](https://www.bithound.io/github/shipzone/npmci)
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
[![build status](https://gitlab.com/shipzone/npmci/badges/master/build.svg)](https://gitlab.com/shipzone/npmci/commits/master)
[![coverage report](https://gitlab.com/shipzone/npmci/badges/master/coverage.svg)](https://gitlab.com/shipzone/npmci/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/@shipzone/npmci.svg)](https://www.npmjs.com/package/@shipzone/npmci)
[![Known Vulnerabilities](https://snyk.io/test/npm/@shipzone/npmci/badge.svg)](https://snyk.io/test/npm/@shipzone/npmci)
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/)
## Usage
@@ -98,9 +93,9 @@ For further information read the linked docs at the top of this README.
Use TypeScript for best in class instellisense.
For further information read the linked docs at the top of this README.
For further information read the linked docs at the top of this readme.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://shipzone.gitlab.io/assets/repo-footer.svg)](https://push.rocks)
[![repo-footer](https://shipzone.gitlab.io/assets/repo-footer.svg)](https://maintainedby.lossless.com)

View File

@@ -165,7 +165,7 @@ export let getDockerBuildArgs = async (): Promise<string> => {
let buildArgsString: string = '';
for (const key in NpmciConfig.configObject.dockerBuildargEnvMap) {
const targetValue = process.env[NpmciConfig.configObject.dockerBuildargEnvMap[key]];
buildArgsString = `${buildArgsString} --build-arg ${key}=${targetValue}`;
buildArgsString = `${buildArgsString} --build-arg ${key}="${targetValue}"`;
}
return buildArgsString;
};

View File

@@ -3,6 +3,8 @@ import * as plugins from './mod.plugins';
import { bash } from '../npmci.bash';
import { repo } from '../npmci.env';
import { configObject } from '../npmci.config';
/**
* handle cli input
* @param argvArg
@@ -15,10 +17,10 @@ export let handleCli = async argvArg => {
await mirror();
break;
default:
logger.log('error', `>>npmci git ...<< action >>${action}<< not supported`);
logger.log('error', `npmci git -> action >>${action}<< not supported!`);
}
} 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.`);
}
};
@@ -26,6 +28,16 @@ export let mirror = async () => {
const githubToken = process.env.NPMCI_GIT_GITHUBTOKEN;
const githubUser = process.env.NPMCI_GIT_GITHUBGROUP || repo.user;
const githubRepo = process.env.NPMCI_GIT_GITHUB || repo.repo;
if (
configObject.projectInfo.npm.packageJson.private === true ||
configObject.npmAccessLevel === 'private'
) {
logger.log(
'warn',
`refusing to mirror due to private property use a private mirror location instead`
);
return;
}
if (githubToken) {
logger.log('info', 'found github token.');
logger.log('info', 'attempting the mirror the repository to GitHub');

View File

@@ -36,7 +36,7 @@ export let install = async versionArg => {
logger.log('info', `now installing node version ${versionArg}`);
let version: string;
if (versionArg === 'stable') {
version = '11';
version = '12';
} else if (versionArg === 'lts') {
version = '10';
} else if (versionArg === 'legacy') {

View File

@@ -42,7 +42,9 @@ const prepare = async () => {
await plugins.smartparam.forEachMinimatch(process.env, 'NPMCI_TOKEN_NPM*', npmEnvArg => {
const npmRegistryUrl = npmEnvArg.split('|')[0];
const npmToken = npmEnvArg.split('|')[1];
npmrcFileString += `//${npmRegistryUrl}/:_authToken="${plugins.smartstring.base64.decode(npmToken)}"\n`;
npmrcFileString += `//${npmRegistryUrl}/:_authToken="${plugins.smartstring.base64.decode(
npmToken
)}"\n`;
});
logger.log('info', `setting default npm registry to ${config.npmRegistryUrl}`);
npmrcFileString += `registry=https://${config.npmRegistryUrl}\n`;

View File

@@ -6,6 +6,7 @@ import { repo } from './npmci.env';
import { KeyValueStore } from '@pushrocks/npmextra';
export interface INpmciOptions {
projectInfo: plugins.projectinfo.ProjectInfo;
npmGlobalTools: string[];
npmAccessLevel?: 'private' | 'public';
npmRegistryUrl: string;
@@ -19,6 +20,7 @@ export let kvStorage = new KeyValueStore('custom', `${repo.user}_${repo.repo}`);
// handle config retrival
const npmciNpmextra = new plugins.npmextra.Npmextra(paths.cwd);
const defaultConfig: INpmciOptions = {
projectInfo: new plugins.projectinfo.ProjectInfo(paths.cwd),
npmGlobalTools: [],
dockerRegistryRepoMap: {},
npmAccessLevel: 'private',

View File

@@ -2,7 +2,7 @@ import { logger } from './npmci.logging';
import * as plugins from './npmci.plugins';
import * as env from './npmci.env';
import { Analytics } from 'smartanalytics';
import { Analytics } from '@pushrocks/smartanalytics';
export let npmciAnalytics = new Analytics({
apiEndPoint: 'https://pubapi.lossless.one/analytics',

View File

@@ -15,7 +15,7 @@ import * as smartparam from '@pushrocks/smartparam';
import * as smartpromise from '@pushrocks/smartpromise';
import * as smartrequest from '@pushrocks/smartrequest';
import * as smartshell from '@pushrocks/smartshell';
import * as smartsocket from 'smartsocket';
import * as smartsocket from '@pushrocks/smartsocket';
import * as smartssh from '@pushrocks/smartssh';
import * as smartstring from '@pushrocks/smartstring';
@@ -36,8 +36,6 @@ export {
smartstring
};
// third party
import * as lodash from 'lodash';
import * as through2 from 'through2';
export { lodash, through2 };
export { through2 };