Basic gating and release jobs of openstackid project

Add check, gate, post and release jobs to PHP/Laravel based openstackid
project. Extend precise node with php5-mcrypt package required for
build process.

Change-Id: If7858412d5c3425aab20c0d11a92cab4c86f47dd
This commit is contained in:
Marton Kiss 2014-02-14 10:22:23 +01:00
parent c9796f0aec
commit f46639efd6
6 changed files with 98 additions and 2 deletions

View File

@ -0,0 +1,12 @@
#!/bin/bash -xe
# Build a Laravel/PHP distribution using composer.
cat >bootstrap/environment.php <<EOF
<?php
\$env = \$app->detectEnvironment(function()
{
return 'dev';
});
EOF
curl -s https://getcomposer.org/installer | /usr/bin/php
php composer.phar install --prefer-dist

View File

@ -52,6 +52,8 @@ class jenkins::params {
$xvfb_package = 'xorg-x11-server-Xvfb'
# PHP package, used for community portal
$php5_cli_package = 'php-cli'
# FIXME: No php mcrypt package on RHEL, used for openstackid
#$php5_mcrypt_package = ''
# For Tooz unit tests
# FIXME: No zookeeper packages on RHEL
#$zookeeper_package = 'zookeeper-server'
@ -130,6 +132,7 @@ class jenkins::params {
$xvfb_package = 'xvfb'
# PHP package, used for community portal
$php5_cli_package = 'php5-cli'
$php5_mcrypt_package = 'php5-mcrypt'
# For [tooz, taskflow, nova] using zookeeper in unit tests
$zookeeper_package = 'zookeeperd'
$cgroups_package = 'cgroup-bin'

View File

@ -128,6 +128,11 @@ class jenkins::slave(
ensure => present,
}
# For openstackid using php5-mcrypt for distro build
package { $::jenkins::params::php5_mcrypt_package:
ensure => present,
}
}
default: {
fail("Unsupported osfamily: ${::osfamily} The 'jenkins' module only supports osfamily Debian or RedHat (slaves only).")

View File

@ -0,0 +1,59 @@
- job:
name: gate-openstackid-unittests
node: 'bare-precise'
builders:
- gerrit-git-prep
- shell: |
#!/bin/bash -xe
/usr/local/jenkins/slave_scripts/php-laravel-build.sh
publishers:
- console-log
- coverage-log
- scp:
site: 'static.openstack.org'
files:
- target: 'logs/$LOG_PATH'
source: './reports/**'
keep-hierarchy: true
copy-after-failure: true
- job-template:
name: 'openstackid-release-{branch-designator}'
node: '{node}'
builders:
- gerrit-git-prep
- shell: |
#!/bin/bash -xe
/usr/local/jenkins/slave_scripts/maven-properties.sh
- inject:
properties-file: maven.properties
- shell: |
#!/bin/bash -xe
/usr/local/jenkins/slave_scripts/php-laravel-build.sh
# Clone to dist
rm -rf dist
mkdir dist
rsync -arv --exclude ".git*" --exclude tarballs --exclude dist . dist
# Clean/create a tarball directory
rm -rf tarballs
mkdir -p tarballs
# Create an archive tarball.
tar -czf openstackid-$PROJECT_VER.tar.gz dist/
cp openstackid-$PROJECT_VER.tar.gz tarballs/openstackid-latest.tar.gz
mv openstackid-$PROJECT_VER.tar.gz tarballs/
publishers:
- console-log
- coverage-log
- scp:
site: 'static.openstack.org'
files:
- target: 'logs/$LOG_PATH'
source: './reports/**'
keep-hierarchy: true
copy-after-failure: true
- target: 'tarballs/openstackid/'
source: 'tarballs/*.tar.gz'
keep-hierarchy: false
copy-after-failure: false

View File

@ -2150,3 +2150,16 @@
branch-designator: 'master'
- 'groups-release-{branch-designator}':
branch-designator: 'branch'
- project:
name: openstackid
github-org: openstack-infra
node: bare-precise
tarball-site: tarballs.openstack.org
jobs:
- gate-openstackid-unittests
- 'openstackid-release-{branch-designator}':
branch-designator: 'master'
- 'openstackid-release-{branch-designator}':
branch-designator: 'branch'

View File

@ -2704,9 +2704,13 @@ projects:
- name: openstack-infra/openstackid
check:
- gate-noop
- gate-openstackid-unittests
gate:
- gate-noop
- gate-openstackid-unittests
post:
- openstackid-release-branch
release:
- openstackid-release-master
- name: openstack-infra/os-loganalyze
check: