Merge "Staged upgrade for npm"

This commit is contained in:
Jenkins 2015-09-23 18:11:08 +00:00 committed by Gerrit Code Review
commit 35694901b0
3 changed files with 27 additions and 5 deletions

View File

@ -55,13 +55,26 @@ class openstack_project::release_slave (
package { ['nodejs', 'nodejs-legacy', 'npm']:
ensure => latest,
before => Exec['upgrade npm'],
before => [
Exec['upgrade npm']
]
}
exec { 'assert npm@2':
command => 'npm install npm@2 -g --upgrade',
path => '/usr/local/bin:/usr/bin',
onlyif => '[ `npm --version | cut -c 1` = "1" ]',
require => [
Package['npm'],
File['/etc/npmrc'],
],
}
exec { 'upgrade npm':
command => 'npm install npm -g --upgrade',
path => '/usr/local/bin:/usr/bin',
onlyif => '[ `npm view npm version` != `npm --version` ]'
onlyif => '[ `npm view npm version` != `npm --version` ]',
require => Exec['assert npm@2'],
}
file { '/home/jenkins/.pypirc':
@ -78,10 +91,18 @@ class openstack_project::release_slave (
owner => 'jenkins',
group => 'jenkins',
mode => '0600',
content => template('openstack_project/npmrc.erb'),
content => template('openstack_project/npmrc_jenkins.erb'),
require => File['/home/jenkins'],
}
file { '/etc/npmrc':
ensure => present,
owner => 'root',
group => 'root',
mode => '0666',
content => template('openstack_project/npmrc_global.erb'),
}
file { '/home/jenkins/.jenkinsci-curl':
ensure => present,
owner => 'jenkins',

View File

@ -0,0 +1,3 @@
tag-version-prefix=
sign-git-tag=true
prefix=/usr/local

View File

@ -4,8 +4,6 @@
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) %>