Zuul v3 support for Packstack jobs

- Do not generate the SSH private key if it already exists
- Set skipsdist = True in tox.ini
- Add Zuul v3 layout

Change-Id: I4b0254bf175d51c0a468b01f8ac034db43859572
This commit is contained in:
Javier Pena 2017-09-29 10:22:29 +02:00
parent 351eace388
commit df7cb04857
6 changed files with 129 additions and 5 deletions

68
.zuul.yaml Normal file
View File

@ -0,0 +1,68 @@
- job:
name: packstack-base
parent: base
timeout: 3600
nodeset: centos-7
pre-run: playbooks/packstack-pre
run: playbooks/packstack-integration-tempest
post-run: playbooks/upload-logs
nodeset: centos-7
irrelevant-files:
- ^docs/.*$
- ^releasenotes/.*$
required-projects:
- openstack/packstack
- openstack/puppet-aodh
- openstack/puppet-ceilometer
- openstack/puppet-cinder
- openstack/puppet-glance
- openstack/puppet-gnocchi
- openstack/puppet-heat
- openstack/puppet-magnum
- openstack/puppet-horizon
- openstack/puppet-ironic
- openstack/puppet-keystone
- openstack/puppet-manila
- openstack/puppet-neutron
- openstack/puppet-nova
- openstack/puppet-openstack_extras
- openstack/puppet-openstacklib
- openstack/puppet-oslo
- openstack/puppet-ovn
- openstack/puppet-panko
- openstack/puppet-sahara
- openstack/puppet-swift
- openstack/puppet-tempest
- openstack/puppet-trove
- openstack/puppet-vswitch
- job:
name: packstack-integration-scenario001-tempest
parent: packstack-base
vars:
scenario: scenario001
- job:
name: packstack-integration-scenario002-tempest
parent: packstack-base
vars:
scenario: scenario002
- job:
name: packstack-integration-scenario003-tempest
parent: packstack-base
vars:
scenario: scenario003
- project:
name: openstack/packstack
check:
jobs:
- packstack-integration-scenario001-tempest
- packstack-integration-scenario002-tempest
- packstack-integration-scenario003-tempest
gate:
jobs:
- packstack-integration-scenario001-tempest
- packstack-integration-scenario002-tempest
- packstack-integration-scenario003-tempest

View File

@ -0,0 +1,13 @@
- hosts: all
name: packstack-integration-tempest
tasks:
- shell:
cmd: |
set -e
set -x
export SCENARIO='{{ scenario }}'
./run_tests.sh
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace/packstack'
environment: '{{ zuul }}'

View File

@ -0,0 +1,26 @@
- hosts: all
name: packstack-pre
tasks:
- name: Ensure legacy workspace directory
file:
path: '{{ ansible_user_dir }}/workspace'
state: directory
- shell:
cmd: |
cp -pr /home/zuul/src/git.openstack.org/openstack/packstack {{ ansible_user_dir }}/workspace
- shell:
cmd: |
set -e
set -x
yum -y remove rdo-release "centos-release-openstack-*" "centos-release-ceph-*"
yum -y install libxml2-devel libxslt-devel ruby-devel zlib-devel
yum -y groupinstall "Development Tools"
# Uninstall python-requests from pip, since we install it in
# system-config/install_puppet.sh
pip uninstall requests -y || true
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
become: true
environment: '{{ zuul }}'

View File

@ -0,0 +1,15 @@
- hosts: all
tasks:
- name: Upload logs
synchronize:
src: '/tmp/logs'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=/logs/**
- --include=*/
- --exclude=*
- --prune-empty-dirs

View File

@ -43,7 +43,6 @@ install_external() {
# - ``PUPPETFILE_DIR`` must be set to Puppet modules directory
# - ``ZUUL_REF`` must be set to Zuul ref. Fallback to 'None'.
# - ``ZUUL_BRANCH`` must be set to Zuul branch. Fallback to 'master'.
# - ``ZUUL_URL`` must be set to Zuul URL
install_openstack() {
cat > clonemap.yaml <<EOF
clonemap:
@ -54,6 +53,7 @@ EOF
# Periodic jobs run without ref on master
ZUUL_REF=${ZUUL_REF:-None}
ZUUL_BRANCH=${ZUUL_BRANCH:-master}
GIT_BASE_URL=${GIT_BASE_URL:-git://git.openstack.org}
local project_names=$(awk '{ if ($1 == ":git") print $3 }' \
Puppetfile0 | tr -d "'," | cut -d '/' -f 4- | xargs
@ -62,8 +62,7 @@ EOF
--cache-dir /opt/git \
--zuul-ref $ZUUL_REF \
--zuul-branch $ZUUL_BRANCH \
--zuul-url $ZUUL_URL \
$GIT_BASE_URL $project_names
git://git.openstack.org $project_names
}
# Install all Puppet modules with r10k
@ -81,7 +80,6 @@ install_all() {
# - ``PUPPETFILE_DIR`` must be set to Puppet modules directory
# - ``ZUUL_REF`` must be set to Zuul ref
# - ``ZUUL_BRANCH`` must be set to Zuul branch
# - ``ZUUL_URL`` must be set to Zuul URL
install_modules() {
# If zuul-cloner is there, have it install modules using zuul refs
if [ -e /usr/zuul-env/bin/zuul-cloner ] ; then
@ -101,7 +99,9 @@ if [ $(id -u) != 0 ]; then
SUDO='sudo -E'
# Packstack will connect as root to localhost, set-up the keypair and sshd
ssh-keygen -t rsa -C "packstack-integration-test" -N "" -f ~/.ssh/id_rsa
if [ ! -f ~/.ssh/id_rsa ]; then
ssh-keygen -t rsa -C "packstack-integration-test" -N "" -f ~/.ssh/id_rsa
fi
$SUDO mkdir -p /root/.ssh
cat ~/.ssh/id_rsa.pub | $SUDO tee -a /root/.ssh/authorized_keys

View File

@ -1,8 +1,10 @@
[tox]
minversion = 1.6
envlist = py27,pep8,releasenotes
skipsdist = True
[testenv]
usedevelop = True
setenv = VIRTUAL_ENV={envdir}
LANG=en_US.UTF-8
LANGUAGE=en_US:en