Added NPM Publishing credentials to pypi slave.
This patch adds an .npmrc file for the jenkins user on our pypi slave. Note that actually publishing to npm will only work on trusty or later. This patch requires a manual step, where a member of infra-root registers the openstackci user on npm, and injects the password into hiera. Note that npm credentials require a user, password, and URL, some of which are specified in site.pp. Change-Id: I13fa91500a7b189e5fb6e915968727e8c1f2a1f4
This commit is contained in:
parent
d67bbc5ee3
commit
efc8402cbd
@ -725,6 +725,9 @@ node 'release.slave.openstack.org' {
|
||||
mavencentral_password => hiera('mavencentral_org_password', 'XXX'),
|
||||
puppet_forge_username => hiera('puppet_forge_username', 'username'),
|
||||
puppet_forge_password => hiera('puppet_forge_password', 'XXX'),
|
||||
npm_username => 'openstackci',
|
||||
npm_userpassword => hiera('npm_user_password', 'XXX'),
|
||||
npm_userurl => 'https://openstack.org',
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,9 @@ class openstack_project::release_slave (
|
||||
$jenkins_gitfullname = 'OpenStack Jenkins',
|
||||
$jenkins_gitemail = 'jenkins@openstack.org',
|
||||
$project_config_repo = 'https://git.openstack.org/openstack-infra/project-config',
|
||||
$npm_username,
|
||||
$npm_userpassword,
|
||||
$npm_userurl,
|
||||
) {
|
||||
class { 'openstack_project::slave':
|
||||
ssh_key => $jenkins_ssh_public_key,
|
||||
@ -50,6 +53,10 @@ class openstack_project::release_slave (
|
||||
require => Class['pip'],
|
||||
}
|
||||
|
||||
package { ['nodejs', 'nodejs-legacy', 'npm']:
|
||||
ensure => latest
|
||||
}
|
||||
|
||||
file { '/home/jenkins/.pypirc':
|
||||
ensure => present,
|
||||
owner => 'jenkins',
|
||||
@ -59,6 +66,15 @@ class openstack_project::release_slave (
|
||||
require => File['/home/jenkins'],
|
||||
}
|
||||
|
||||
file { '/home/jenkins/.npmrc':
|
||||
ensure => present,
|
||||
owner => 'jenkins',
|
||||
group => 'jenkins',
|
||||
mode => '0600',
|
||||
content => template('openstack_project/npmrc.erb'),
|
||||
require => File['/home/jenkins'],
|
||||
}
|
||||
|
||||
file { '/home/jenkins/.jenkinsci-curl':
|
||||
ensure => present,
|
||||
owner => 'jenkins',
|
||||
|
12
modules/openstack_project/templates/npmrc.erb
Normal file
12
modules/openstack_project/templates/npmrc.erb
Normal file
@ -0,0 +1,12 @@
|
||||
<%
|
||||
require 'base64'
|
||||
%>
|
||||
init.author.name=<%= jenkins_gitfullname %>
|
||||
init.author.email=<%= jenkins_gitemail %>
|
||||
init.author.url=<%= npm_userurl %>
|
||||
tag-version-prefix=
|
||||
sign-git-tag=true
|
||||
|
||||
//registry.npmjs.org/:username=<%= npm_username %>
|
||||
//registry.npmjs.org/:_password=<%= Base64.encode64(npm_userpassword) %>
|
||||
//registry.npmjs.org/:email=<%= jenkins_gitemail %>
|
Loading…
x
Reference in New Issue
Block a user