Compare commits

...

10 Commits

Author SHA1 Message Date
67ff5d09d4 3.1.14 2018-12-09 16:48:33 +01:00
5cb8a79b6a fix(core): update 2018-12-09 16:48:33 +01:00
2dcbca2362 3.1.13 2018-12-09 16:26:28 +01:00
bd63194f4b fix(core): update 2018-12-09 16:26:28 +01:00
2763fdef5f 3.1.12 2018-12-09 15:53:39 +01:00
bbedde01b9 fix(core): update 2018-12-09 15:53:38 +01:00
f26606f757 3.1.11 2018-12-09 15:22:20 +01:00
99b03aa796 fix(core): update 2018-12-09 15:22:20 +01:00
f30dd3da65 3.1.10 2018-12-09 14:59:51 +01:00
d4decddb4b fix(core): update 2018-12-09 14:59:51 +01:00
5 changed files with 12 additions and 9 deletions

View File

@@ -6,7 +6,8 @@
},
"npmci": {
"npmGlobalTools": [],
"npmAccessLevel": "public"
"npmAccessLevel": "public",
"npmRegistryUrl": "registry.npmjs.org"
},
"npmdocker":{
"baseImage":"hosttoday/ht-docker-node:npmci",

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "@shipzone/npmci",
"version": "3.1.9",
"version": "3.1.14",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "@shipzone/npmci",
"version": "3.1.9",
"version": "3.1.14",
"description": "node and docker in gitlab ci on steroids",
"main": "dist/index.js",
"typings": "dist/index.d.ts",

View File

@@ -39,12 +39,15 @@ export let handleCli = async argvArg => {
const prepare = async () => {
const config = await configModule.getConfig();
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 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}`);
npmrcFileString += `registry=https://${config.npmRegistryUrl}\n`;
// final check
if (npmrcFileString.length > 0) {
logger.log('info', 'found one or more access tokens');
} else {
@@ -52,9 +55,8 @@ const prepare = async () => {
process.exit(1);
}
// lets save it to disk
plugins.smartfile.memory.toFsSync(npmrcFileString, '/root/.npmrc');
logger.log('info', `setting default npm registry to ${config.npmRegistryUrl}`);
await bash(`npm set registry https://${config.npmRegistryUrl}`);
return;
};
@@ -76,7 +78,7 @@ const publish = async () => {
// -> configure registry url
if (config.npmRegistryUrl) {
npmAccessCliString = `--registry=${config.npmRegistryUrl}`;
npmAccessCliString = `--registry=https://${config.npmRegistryUrl}`;
} else {
logger.log('error', `no registry url specified. Can't publish!`);
process.exit(1);

View File

@@ -6,7 +6,7 @@ const triggerValueRegex = /^([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)\|([a-zA-Z0-9\.]*)
export let trigger = async () => {
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 => {