782501b228
This commit fixes bug 1182154 The maven workflow for versioning and deployment is at odds with how we like to do it. For versioning, our convention is to get info from SCM to set the project build versions. For deployments to remote repositories we prefer to use curl instead of mvn deploy due to maven security vulnerabilities. Our python builds have already been setup to set package versions from SCM and deploy to pypi using curl so this commit is to make maven versioning and deployments similiar our python versioning and deployment workflow. This commit does the following: Setup a project version string as an environement variable so we can pass it to maven builds. The version string is retrieved from information in git. This makes the build versioning workflow similar to how we build python packages. This setup expects a variable called '$project-version' in the root 'version' element (i.e. <version>${project-version}</version>) of the maven project's pom.xml file. For general (throw away CI) builds we do the following: 1. generate a package 'myplugin.hpi' with version '1.3.0.4.a0bc21f' in the MANIFEST.MF file. The '4' is the number of commits since last tag. 2. publish 'myplugin-1.3.0.4.a0bc21f.hpi' to tarballs.o.o For release builds we do the following: 1. generate a package 'myplugin.hpi' with version '1.3.1' in the MANIFEST.MF file. 2. publish 'myplugin-1.3.1.hpi' to tarballs.o.o 3. publish 'myplugin-1.3.1.hpi' to repo.jenkins-ci.org Passes the jenkins credentials from hiera to the pypi slave so we can use it to deploy released plugins to repo.jenkins-ci.org Creates a generic jenkinsci-upload job that will deploy released jenkins plugin artifacts to a remote repository with user credentials from hiera. It will use the same curl deployment method as the pypi-upload job. Change-Id: If1306523a28da94ee970d96b7a788ca116348de7 Reviewed-on: https://review.openstack.org/31875 Reviewed-by: Monty Taylor <mordred@inaugust.com> Reviewed-by: Clark Boylan <clark.boylan@gmail.com> Reviewed-by: Jeremy Stanley <fungi@yuggoth.org> Approved: Clark Boylan <clark.boylan@gmail.com> Tested-by: Jenkins
56 lines
1.5 KiB
Puppet
56 lines
1.5 KiB
Puppet
# Copyright 2012 Hewlett-Packard Development Company, L.P.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
#
|
|
# Class to install dependencies for uploading python packages to pypi and
|
|
# maven repositories
|
|
#
|
|
class openstack_project::pypi_slave (
|
|
$pypi_password,
|
|
$jenkins_ssh_public_key,
|
|
$pypi_username = 'openstackci',
|
|
$jenkinsci_username,
|
|
$jenkinsci_password
|
|
) {
|
|
class { 'openstack_project::slave':
|
|
ssh_key => $jenkins_ssh_public_key,
|
|
}
|
|
|
|
include pip
|
|
|
|
package { 'pkginfo':
|
|
ensure => present,
|
|
provider => 'pip',
|
|
require => Class['pip'],
|
|
}
|
|
|
|
file { '/home/jenkins/.pypicurl':
|
|
ensure => present,
|
|
owner => 'jenkins',
|
|
group => 'jenkins',
|
|
mode => '0600',
|
|
content => template('openstack_project/pypicurl.erb'),
|
|
require => File['/home/jenkins'],
|
|
}
|
|
|
|
file { '/home/jenkins/.jenkinsci-curl':
|
|
ensure => present,
|
|
owner => 'jenkins',
|
|
group => 'jenkins',
|
|
mode => '0600',
|
|
content => template('openstack_project/jenkinsci-curl.erb'),
|
|
require => File['/home/jenkins'],
|
|
}
|
|
|
|
}
|