Migrate to Zuul v3

This patch do step 1 in the docs: Move Legacy Jobs to Projects.

Co-Authored-By: Kien Nguyen <kiennt@vn.fujitsu.com>
Change-Id: I25f13b53e08d9065baa8ce93149831714512410e
Partial-Implements: blueprint migrate-to-zuulv3
This commit is contained in:
Hongbin Lu 2017-10-02 16:45:32 +00:00 committed by Kien Nguyen
parent 6e50011b34
commit 26249ff1db
5 changed files with 276 additions and 0 deletions

74
.zuul.yaml Normal file
View File

@ -0,0 +1,74 @@
- job:
name: zun-devstack-base
parent: legacy-dsvm-base
timeout: 4200
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
vars:
database: sql
use_python3: 0
required-projects:
- openstack-dev/devstack
- openstack-infra/devstack-gate
- openstack/devstack-plugin-container
- openstack/kuryr-libnetwork
- openstack/zun
- openstack/python-zunclient
- openstack/zun-tempest-plugin
run: playbooks/zun-devstack-base/run
post-run: playbooks/zun-devstack-base/post
- job:
name: zun-devstack-base-multinode
parent: legacy-dsvm-base-multinode
timeout: 7800
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
required-projects:
- openstack-dev/devstack
- openstack-infra/devstack-gate
- openstack/devstack-plugin-container
- openstack/kuryr-libnetwork
- openstack/zun
- openstack/python-zunclient
- openstack/zun-tempest-plugin
nodeset: legacy-ubuntu-xenial-2-node
run: playbooks/zun-devstack-base-multinode/run
post-run: playbooks/zun-devstack-base-multinode/post
- job:
name: zun-tempest-docker-sql
parent: zun-devstack-base
- job:
name: zun-tempest-py35-docker-sql
parent: zun-devstack-base
vars:
use_python3: 1
- job:
name: zun-tempest-multinode-docker-sql
parent: zun-devstack-base-multinode
voting: false
- job:
name: zun-tempest-docker-etcd
parent: zun-devstack-base
voting: false
vars:
database: etcd
- project:
name: openstack/zun
check:
jobs:
- zun-tempest-docker-sql
- zun-tempest-py35-docker-sql
- zun-tempest-docker-etcd
- zun-tempest-multinode-docker-sql
gate:
jobs:
- zun-tempest-docker-sql
- zun-tempest-py35-docker-sql

View File

@ -0,0 +1,15 @@
- hosts: primary
tasks:
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=/logs/**
- --include=*/
- --exclude=*
- --prune-empty-dirs

View File

@ -0,0 +1,84 @@
- hosts: primary
name: Zun devstack base multinode
tasks:
- name: Ensure workspace directory
file:
path: '{{ ansible_user_dir }}/workspace'
state: directory
- shell:
cmd: |
set -e
set -x
cat > clonemap.yaml << EOF
clonemap:
- name: openstack-infra/devstack-gate
dest: devstack-gate
EOF
/usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \
git://git.openstack.org \
openstack-infra/devstack-gate
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -e
set -x
cat << 'EOF' >>"/tmp/dg-local.conf"
[[local|localrc]]
enable_plugin zun git://git.openstack.org/openstack/zun
[[post-config|$KURYR_CONFIG]]
[DEFAULT]
capability_scope = global
debug = True
EOF
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -e
set -x
export PYTHONUNBUFFERED=true
export DEVSTACK_GATE_TEMPEST=1
export DEVSTACK_GATE_NEUTRON=1
# Enable tempest for tempest plugin
export ENABLED_SERVICES=tempest
export PROJECTS="openstack/zun $PROJECTS"
export PROJECTS="openstack/kuryr-libnetwork $PROJECTS"
export PROJECTS="openstack/python-zunclient $PROJECTS"
export PROJECTS="openstack/devstack-plugin-container $PROJECTS"
export PROJECTS="openstack/zun-tempest-plugin $PROJECTS"
# Keep localrc to be able to set some vars in post_test_hook
export KEEP_LOCALRC=1
export DEVSTACK_GATE_TOPOLOGY="multinode"
function gate_hook {
cd /opt/stack/new/zun/
./zun/tests/contrib/gate_hook.sh docker sql
}
export -f gate_hook
function post_test_hook {
source $BASE/new/devstack/accrc/admin/admin
cd /opt/stack/new/zun/
./zun/tests/contrib/post_test_hook.sh docker
}
export -f post_test_hook
cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh
./safe-devstack-vm-gate-wrap.sh
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'

View File

@ -0,0 +1,15 @@
- hosts: primary
tasks:
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=/logs/**
- --include=*/
- --exclude=*
- --prune-empty-dirs

View File

@ -0,0 +1,88 @@
- hosts: all
name: Zun devstack base
tasks:
- name: Ensure workspace directory
file:
path: '{{ ansible_user_dir }}/workspace'
state: directory
- shell:
cmd: |
set -e
set -x
cat > clonemap.yaml << EOF
clonemap:
- name: openstack-infra/devstack-gate
dest: devstack-gate
EOF
/usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \
git://git.openstack.org \
openstack-infra/devstack-gate
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -e
set -x
cat << 'EOF' >>"/tmp/dg-local.conf"
[[local|localrc]]
enable_plugin zun git://git.openstack.org/openstack/zun
EOF
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -e
set -x
export PYTHONUNBUFFERED=true
export DEVSTACK_GATE_TEMPEST=0
export DEVSTACK_GATE_NEUTRON=1
# Enable tempest for tempest plugin
export ENABLED_SERVICES=tempest
export PROJECTS="openstack/zun $PROJECTS"
export PROJECTS="openstack/kuryr-libnetwork $PROJECTS"
export PROJECTS="openstack/python-zunclient $PROJECTS"
export PROJECTS="openstack/devstack-plugin-container $PROJECTS"
export PROJECTS="openstack/zun-tempest-plugin $PROJECTS"
# Keep localrc to be able to set some vars in post_test_hook
export KEEP_LOCALRC=1
if [ "{{ use_python3 }}" -eq 1 ] ; then
export DEVSTACK_GATE_USE_PYTHON3=True
# Swift does not work so skip s-* for python3x for now
export DEVSTACK_LOCAL_CONFIG+=$'\n'"disable_service s-account"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"disable_service s-container"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"disable_service s-object"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"disable_service s-proxy"
else
export DEVSTACK_GATE_USE_PYTHON3=False
fi
function gate_hook {
cd /opt/stack/new/zun/
./zun/tests/contrib/gate_hook.sh docker "{{ database }}"
}
export -f gate_hook
function post_test_hook {
source $BASE/new/devstack/accrc/admin/admin
cd /opt/stack/new/zun/
./zun/tests/contrib/post_test_hook.sh docker
}
export -f post_test_hook
cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh
./safe-devstack-vm-gate-wrap.sh
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'