Compare commits

...

4 Commits

Author SHA1 Message Date
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
4 changed files with 9 additions and 7 deletions

View File

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

2
package-lock.json generated
View File

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

View File

@@ -1,6 +1,6 @@
{ {
"name": "@shipzone/npmci", "name": "@shipzone/npmci",
"version": "3.1.10", "version": "3.1.12",
"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",

View File

@@ -42,9 +42,12 @@ const prepare = async () => {
plugins.smartparam.forEachMinimatch(process.env, 'NPMCI_TOKEN_NPM*', npmEnvArg => { 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="${npmToken}"\n`;
}); });
logger.log('info', `setting default npm registry to ${config.npmRegistryUrl}`);
npmrcFileString += `registry=https://${config.npmRegistryUrl}\n`;
// final check
if (npmrcFileString.length > 0) { if (npmrcFileString.length > 0) {
logger.log('info', 'found one or more access tokens'); logger.log('info', 'found one or more access tokens');
} else { } else {
@@ -52,9 +55,8 @@ const prepare = async () => {
process.exit(1); process.exit(1);
} }
// lets save it to disk
plugins.smartfile.memory.toFsSync(npmrcFileString, '/root/.npmrc'); 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; return;
}; };
@@ -76,7 +78,7 @@ const publish = async () => {
// -> configure registry url // -> configure registry url
if (config.npmRegistryUrl) { if (config.npmRegistryUrl) {
npmAccessCliString = `--registry=${config.npmRegistryUrl}`; npmAccessCliString = `--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);