Open kevinSuttle opened 8 years ago
We need to be able to perform a npm publish
during Travis builds desperately. Otherwise publishing is too manual and breaks CI automated workflows.
@jbaskeen FWIW npm Enterprise has a concept of "deploy tokens" that are meant for CI usage and do not depend on your configured auth provider like GHE.
You can create a deploy token using the npme
bin on your host:
$ npme manage-tokens generate
? npm username travis-ci
? email address travis-ci@example.com
generated token: deploy_f5f54069-df3b-4d2c-8113-93b4111610cb
You could then plug this token value into an environment variable like NPM_TOKEN
in your Travis settings:
And use a before_install
directive like the following in your Travis project config to use the env var:
language: node_js
node_js:
- "node"
before_install:
- printf "registry=http://npm-registry.example.com:8080/\n//npm-registry.example.com:8080/:_authToken=${NPM_TOKEN}\n" >> ~/.npmrc
This should give your CI builds access to install and publish packages from/to your npm Enterprise registry.
@nexdrew Yeah. I'm actively trying to avoid npme's deploy tokens as I'm one of 2 admins for an appliance that will most likely reach thousands of developers. @bcoe and I have had long discussions about it. :)
@nexdrew I cannot seem to get this to work with AWS CodeBuild or locally. I keep getting:
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
To what AUTH settings do I need to configure my NPMe environment? I've set it to GH Auth now but that from what I understand that shouldn't matter with this deploy token..
My .npmrc looks like:
@myscope:registry=http://mydomain.com:8080/
//mydomain.com.com:8080/:_authToken=deploy_my_random_key
And the command I try to run:
npm publish --scope=@myscope --registry=http://mydomian.com:8080/
@tvb I no longer work for npm and thus do not have easy access to an npm Enterprise instance.
@bcoe @arobson Can one of you please help Tristan?
Personal access tokens and/or deploy keys, login, CI/CD, etc.