[FOLIO-928] Integrate stripes-cli into Jenkins Created: 08/Nov/17  Updated: 12/Nov/18  Resolved: 09/Nov/17

Status: Closed
Project: FOLIO
Components: Continuous Integration
Affects versions: None
Fix versions: None

Type: Task Priority: P3
Reporter: Matthew Jones Assignee: John Malconian
Resolution: Done Votes: 0
Labels: ci
Remaining Estimate: Not Specified
Time Spent: 30 minutes
Original estimate: Not Specified

Issue links:
Relates
relates to STCLI-1 Stripes CLI Closed
Sprint:

 Description   

Stripes-cli is a new repo containing a prototype CLI for developing and Stripes UI modules.
https://github.com/folio-org/stripes-cli

I'd like to integrate this new repository with Jenkins CI workflow so that stripes-cli is automatically published to npm-folioci.



 Comments   
Comment by John Malconian [ 08/Nov/17 ]

Set up repo for CI, however, for some reason, there is an auth error publishing the package to the CI repo, npm-folioci.

NPM debug Log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'publish' ]
2 info using npm@3.10.10
3 info using node@v6.11.4
4 verbose publish [ '.' ]
5 silly cache add args [ '.', null ]
6 verbose cache add spec .
7 silly cache add parsed spec Result {
7 silly cache add   raw: '.',
7 silly cache add   scope: null,
7 silly cache add   escapedName: null,
7 silly cache add   name: null,
7 silly cache add   rawSpec: '.',
7 silly cache add   spec: '/home/jenkins/stripes-cli',
7 silly cache add   type: 'directory' }
8 verbose addLocalDirectory /home/jenkins/.npm/@folio/stripes-cli/0.1.0/package.tgz not in flight
; packing
9 verbose correctMkdir /home/jenkins/.npm correctMkdir not in flight; initializing
10 info lifecycle @folio/stripes-cli@0.1.0~prepublish: @folio/stripes-cli@0.1.0
11 silly lifecycle @folio/stripes-cli@0.1.0~prepublish: no script for prepublish, continuing
12 verbose tar pack [ '/home/jenkins/.npm/@folio/stripes-cli/0.1.0/package.tgz',
12 verbose tar pack   '/home/jenkins/stripes-cli' ]
13 verbose tarball /home/jenkins/.npm/@folio/stripes-cli/0.1.0/package.tgz
14 verbose folder /home/jenkins/stripes-cli
15 verbose addLocalTarball adding from inside cache /home/jenkins/.npm/@folio/stripes-cli/0.1.0/p
ackage.tgz
16 verbose correctMkdir /home/jenkins/.npm correctMkdir not in flight; initializing
17 silly cache afterAdd @folio/stripes-cli@0.1.0
18 verbose afterAdd /home/jenkins/.npm/@folio/stripes-cli/0.1.0/package/package.json not in fligh
t; writing
19 verbose correctMkdir /home/jenkins/.npm correctMkdir not in flight; initializing
20 verbose afterAdd /home/jenkins/.npm/@folio/stripes-cli/0.1.0/package/package.json written
21 silly publish { name: '@folio/stripes-cli',
21 silly publish   version: '0.1.0',
21 silly publish   description: 'Stripes Command Line Interface',
21 silly publish   repository:
21 silly publish    { type: 'git',
21 silly publish      url: 'git+https://github.com/folio-org/stripes-cli.git' },
21 silly publish   publishConfig: { registry: 'https://repository.folio.org/repository/npm-folio/
' },
21 silly publish   license: 'Apache-2.0',
21 silly publish   engines: { node: '>=6.0.0' },
21 silly publish   main: 'index.js',
21 silly publish   bin: { str: './lib/stripes-cli.js' },
21 silly publish   scripts:
21 silly publish    { test: 'echo "Error: no test specified" && exit 1',
21 silly publish      lint: 'eslint ./' },
21 silly publish   dependencies:
21 silly publish    { '@folio/stripes-core': 'github:folio-org/stripes-core#stripes-cli',
21 silly publish      commander: '^2.11.0',
21 silly publish      'just-kebab-case': '^1.0.0',
21 silly publish      'just-pascal-case': '^1.0.0',
21 silly publish      kopy: '^8.2.3',
21 silly publish      resolve: '^1.4.0',
21 silly publish      'update-notifier': '^2.3.0' },
21 silly publish   devDependencies: { eslint: '^4.7.2', 'eslint-config-stripes': '^1.0.0' },
21 silly publish   readme: '# Stripes CLI\n\nCopyright (C) 2017 The Open Library Foundation\n\nTh
is software is distributed under the terms of the Apache License,\nVersion 2.0. See the file "[LI
CENSE](LICENSE)" for more information.\n\n## Introduction\n\n*Note: This is an early prototype an
d not ready to fully scaffold a new Stripes UI module.*\n\nStripes CLI is a command line interfac
e to facilitate the creation, development, building, and testing of Stripes UI modules.\n\n## Ins
tallation\n\nStripes CLI is currently unpublished, so a quick way to take it for a spin is to run
:\n```\nnpm install -g folio-org/stripes-cli\n```\n\nTo develop the CLI:\n1. Clone this repo\n1. 
From the `stripes-cli` directory, run:\n```\nnpm install -g\n```\n\n## Available commands\n\nStri
pes CLI is currently invoked using `str` rather than `stripes` so it can run side-by-side with co
mmands currently integrated within stripes-core.\n\n* `serve` or `dev`: Serve up an app or platfo
rm with the development server.\n* `build`: Build a static tenant bundle.\n* `new`: Create a new 
UI module (work in progress).\n* `test`: Runs tests (not implemented).\n\nRun each command with `
--help` to view available options.\n\nPrevious `dev` and `build` commands continue to work as exp
ected for existing platforms given a file argument like `stripes.config.js` is provided.  However
, stripes-cli will now generate a config when the config file is omitted.  This is most useful fo
r developing a new ui-app in isolation within its own virtual platform as there is no need clone 
or link supporting repositories.\n\n\n## Example usage\n\nCreate a new stripes UI app and directo
ry: \n```\nstr new app "Hello World"\n```\n\nRun the newly created stripes UI app from within its
 own directory:\n```\nstr serve --allperms\n```\n(This assumes dependencies have previously been 
yarn installed and a suitable OKAPI backend is running locally on port 9130)\n',
21 silly publish   readmeFilename: 'README.md',
21 silly publish   gitHead: '4f99b0ab7b4fd2ddf19117788bc988522659338d',
21 silly publish   bugs: { url: 'https://github.com/folio-org/stripes-cli/issues' },
21 silly publish   homepage: 'https://github.com/folio-org/stripes-cli#readme',
21 silly publish   _id: '@folio/stripes-cli@0.1.0',
21 silly publish   _shasum: 'f8ca0492cc9d244cf4934cc6cb150d1a0043bfab',
21 silly publish   _from: '.' }
22 verbose getPublishConfig { registry: 'https://repository.folio.org/repository/npm-folio/' }
23 silly mapToRegistry name @folio/stripes-cli
24 silly mapToRegistry scope (from package name) @folio
25 silly mapToRegistry registry https://repository.folio.org/repository/npm-folioci/
26 silly mapToRegistry data Result {
26 silly mapToRegistry   raw: '@folio/stripes-cli',
26 silly mapToRegistry   scope: '@folio',
26 silly mapToRegistry   escapedName: '@folio%2fstripes-cli',
26 silly mapToRegistry   name: '@folio/stripes-cli',
26 silly mapToRegistry   rawSpec: '',
26 silly mapToRegistry   spec: 'latest',
26 silly mapToRegistry   type: 'tag' }
27 silly mapToRegistry uri https://repository.folio.org/repository/npm-folioci/@folio%2fstripes-c
li
28 verbose publish registryBase https://repository.folio.org/repository/npm-folioci/
29 silly publish uploading /home/jenkins/.npm/@folio/stripes-cli/0.1.0/package.tgz
30 verbose stack Error: auth required for publishing
30 verbose stack     at CachingRegistryClient.publish (/usr/lib/node_modules/npm/node_modules/npm
-registry-client/lib/publish.js:30:14)
30 verbose stack     at /usr/lib/node_modules/npm/lib/publish.js:138:14
30 verbose stack     at mapToRegistry (/usr/lib/node_modules/npm/lib/utils/map-to-registry.js:62:
3)
30 verbose stack     at publish_ (/usr/lib/node_modules/npm/lib/publish.js:107:3)
30 verbose stack     at Array.<anonymous> (/usr/lib/node_modules/npm/node_modules/slide/lib/bind-
actor.js:15:8)
30 verbose stack     at LOOP (/usr/lib/node_modules/npm/node_modules/slide/lib/chain.js:15:14)
30 verbose stack     at LOOP (/usr/lib/node_modules/npm/node_modules/slide/lib/chain.js:14:28)
30 verbose stack     at chain (/usr/lib/node_modules/npm/node_modules/slide/lib/chain.js:20:5)
30 verbose stack     at /usr/lib/node_modules/npm/lib/publish.js:73:5
30 verbose stack     at RES (/usr/lib/node_modules/npm/node_modules/inflight/inflight.js:23:14)
31 verbose cwd /home/jenkins/stripes-cli
32 error Linux 4.9.38-16.33.amzn1.x86_64
33 error argv "/usr/bin/node" "/usr/bin/npm" "publish"
34 error node v6.11.4
35 error npm  v3.10.10
36 error code ENEEDAUTH
37 error need auth auth required for publishing
38 error need auth You need to authorize this machine using `npm adduser`
39 verbose exit [ 1, true ]

I think its due to the presence of a .npmrc in the project directory that is overriding the default .npmrc that contains the authentication token.

Comment by John Malconian [ 09/Nov/17 ]

Modified NPM build pipeline to always override any existing .npmrc. 'npm publish' now works.

Generated at Thu Feb 08 23:09:21 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.