Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f876c7414b | |||
| 08b7585cfc | |||
| 76311fab72 | |||
| 1b73df64f5 | |||
| 701cee573b | |||
| 3dd086f711 | |||
| 67ff5d09d4 | |||
| 5cb8a79b6a | |||
| 2dcbca2362 | |||
| bd63194f4b |
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@shipzone/npmci",
|
"name": "@shipzone/npmci",
|
||||||
"version": "3.1.12",
|
"version": "3.1.17",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@shipzone/npmci",
|
"name": "@shipzone/npmci",
|
||||||
"version": "3.1.12",
|
"version": "3.1.17",
|
||||||
"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",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ export let getDockerBuildArgs = async (): Promise<string> => {
|
|||||||
let buildArgsString: string = '';
|
let buildArgsString: string = '';
|
||||||
for (const key in NpmciConfig.configObject.dockerBuildargEnvMap) {
|
for (const key in NpmciConfig.configObject.dockerBuildargEnvMap) {
|
||||||
const targetValue = process.env[NpmciConfig.configObject.dockerBuildargEnvMap[key]];
|
const targetValue = process.env[NpmciConfig.configObject.dockerBuildargEnvMap[key]];
|
||||||
buildArgsString = `${buildArgsString} --build-arg ${key}=${targetValue}`;
|
buildArgsString = `${buildArgsString} --build-arg ${key}="${targetValue}"`;
|
||||||
}
|
}
|
||||||
return buildArgsString;
|
return buildArgsString;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -39,10 +39,10 @@ export let handleCli = async argvArg => {
|
|||||||
const prepare = async () => {
|
const prepare = async () => {
|
||||||
const config = await configModule.getConfig();
|
const config = await configModule.getConfig();
|
||||||
let npmrcFileString: string = '';
|
let npmrcFileString: string = '';
|
||||||
plugins.smartparam.forEachMinimatch(process.env, 'NPMCI_TOKEN_NPM*', npmEnvArg => {
|
await plugins.smartparam.forEachMinimatch(process.env, 'NPMCI_TOKEN_NPM*', npmEnvArg => {
|
||||||
const npmRegistryUrl = npmEnvArg.split('|')[0];
|
const npmRegistryUrl = npmEnvArg.split('|')[0];
|
||||||
const npmToken = npmEnvArg.split('|')[1];
|
const npmToken = npmEnvArg.split('|')[1];
|
||||||
npmrcFileString += `//${npmRegistryUrl}/:_authToken="${npmToken}"\n`;
|
npmrcFileString += `//${npmRegistryUrl}/:_authToken="${plugins.smartstring.base64.decode(npmToken)}"\n`;
|
||||||
});
|
});
|
||||||
logger.log('info', `setting default npm registry to ${config.npmRegistryUrl}`);
|
logger.log('info', `setting default npm registry to ${config.npmRegistryUrl}`);
|
||||||
npmrcFileString += `registry=https://${config.npmRegistryUrl}\n`;
|
npmrcFileString += `registry=https://${config.npmRegistryUrl}\n`;
|
||||||
@@ -78,7 +78,7 @@ const publish = async () => {
|
|||||||
|
|
||||||
// -> configure registry url
|
// -> configure registry url
|
||||||
if (config.npmRegistryUrl) {
|
if (config.npmRegistryUrl) {
|
||||||
npmAccessCliString = `--registry=https://${config.npmRegistryUrl}`;
|
npmRegistryCliString = `--registry=https://${config.npmRegistryUrl}`;
|
||||||
} else {
|
} else {
|
||||||
logger.log('error', `no registry url specified. Can't publish!`);
|
logger.log('error', `no registry url specified. Can't publish!`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const triggerValueRegex = /^([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)
|
|||||||
|
|
||||||
export let trigger = async () => {
|
export let trigger = async () => {
|
||||||
logger.log('info', 'now running triggers');
|
logger.log('info', 'now running triggers');
|
||||||
plugins.smartparam.forEachMinimatch(process.env, 'NPMCI_TRIGGER_*', evaluateTrigger);
|
await plugins.smartparam.forEachMinimatch(process.env, 'NPMCI_TRIGGER_*', evaluateTrigger);
|
||||||
};
|
};
|
||||||
|
|
||||||
const evaluateTrigger = async triggerEnvVarArg => {
|
const evaluateTrigger = async triggerEnvVarArg => {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { KeyValueStore } from '@pushrocks/npmextra';
|
|||||||
export interface INpmciOptions {
|
export interface INpmciOptions {
|
||||||
npmGlobalTools: string[];
|
npmGlobalTools: string[];
|
||||||
npmAccessLevel?: 'private' | 'public';
|
npmAccessLevel?: 'private' | 'public';
|
||||||
npmRegistryUrl?: string;
|
npmRegistryUrl: string;
|
||||||
dockerRegistryRepoMap: any;
|
dockerRegistryRepoMap: any;
|
||||||
dockerBuildargEnvMap: any;
|
dockerBuildargEnvMap: any;
|
||||||
}
|
}
|
||||||
@@ -21,6 +21,8 @@ const npmciNpmextra = new plugins.npmextra.Npmextra(paths.cwd);
|
|||||||
const defaultConfig: INpmciOptions = {
|
const defaultConfig: INpmciOptions = {
|
||||||
npmGlobalTools: [],
|
npmGlobalTools: [],
|
||||||
dockerRegistryRepoMap: {},
|
dockerRegistryRepoMap: {},
|
||||||
|
npmAccessLevel: 'private',
|
||||||
|
npmRegistryUrl: 'registry.npmjs.org',
|
||||||
dockerBuildargEnvMap: {}
|
dockerBuildargEnvMap: {}
|
||||||
};
|
};
|
||||||
export let configObject = npmciNpmextra.dataFor<INpmciOptions>('npmci', defaultConfig);
|
export let configObject = npmciNpmextra.dataFor<INpmciOptions>('npmci', defaultConfig);
|
||||||
|
|||||||
Reference in New Issue
Block a user