jenkinsartifactorynpm-publish.npmrc

Update .nprmc file with Artificatory credentials from Jenkins job


I am trying to publish my npm module to artifactory repository from Jenkins. Can someone help me with how to add artifactory credentials to .nprmc file from Jenkins job? I'm trying to make this credential configuration job specific.


Solution

  • You can publish npm modules easily using the Jenkins Artifactory plugin. With that, you don't have to configure the credentials in .npmrc - the plugin already does it for you. You'll get also other benefits such as build information.

    Declarative pipeline: See documentation here and an example here.

    Scripted pipeline: See documentation here and an example here.