Skip to content

Commit

Permalink
Pipeline publishing fixed (#273)
Browse files Browse the repository at this point in the history
Signed-off-by: Kestutis Gudynas <44440041+kemi04@users.noreply.github.com>
  • Loading branch information
kemi04 authored Apr 22, 2021
1 parent 9b80078 commit 1d43015
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tools/toolchain/verdaccio/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const gulp = require('gulp');
const { shell: runcmds } = require('../shell/cmd');
const util = require('util');
const path = require('path');
const ip = require('ip');

// Install from the dirs for use within the development context
const installDir = (commands) =>{
Expand All @@ -25,8 +26,8 @@ const installDir = (commands) =>{
const packageJSON = require(`../../../${npm_package.category}/${npm_package.name}/package.json`);
const npm_tag = packageJSON.tag;
const modulepath = path.resolve(`../../../${npm_package.category}/${npm_package.name}/`);
commands.push(util.format('npm publish --registry http://localhost:4873 %s --tag %s', modulepath, npm_tag));
commands.push(util.format('npm view --registry http://localhost:4873 %s', npm_package.name));
commands.push(util.format(`npm publish --registry http://${ip.address()}:4873 %s --tag %s`, modulepath, npm_tag));
commands.push(util.format(`npm view --registry http://${ip.address()}:4873 %s`, npm_package.name));
}

return commands;
Expand All @@ -46,8 +47,8 @@ const installTGZ = (commands) =>{
const packageJSON = require(`../../../${npm_package.category}/${npm_package.name}/package.json`);
const npm_tag = packageJSON.tag;
const name = `${npm_package.name}-${packageJSON.version}.tgz`;
commands.push(util.format('npm publish --registry http://localhost:4873 ../../../build/%s --tag %s', name, npm_tag));
commands.push(util.format('npm view --registry http://localhost:4873 %s', npm_package.name));
commands.push(util.format(`npm publish --registry http://${ip.address()}:4873 ../../../build/%s --tag %s`, name, npm_tag));
commands.push(util.format(`npm view --registry http://${ip.address()}:4873 %s`, npm_package.name));
}


Expand All @@ -60,8 +61,8 @@ const verdaccioStart = async () => {
'docker rm -f verdaccio || true',
util.format('docker run -d -p 4873:4873 -v %s/config.yaml:/verdaccio/conf/config.yaml --name verdaccio verdaccio/verdaccio', __dirname),
'sleep 5', // verdaccio takes a while to start
'npm config delete //localhost:4873/:_authToken',
'npm-cli-login -u testuser -p testpass -e testuser@example.org -r http://localhost:4873',
`npm config delete //${ip.address()}:4873/:_authToken`,
`npm-cli-login -u testuser -p testpass -e testuser@example.org -r http://${ip.address()}:4873`,
'sleep 5' // avoid "jwt not active" error
];

Expand Down

0 comments on commit 1d43015

Please sign in to comment.