Migrate templates job to Zuul v3
Migrate templates job to zuul v3. Migrating guideline: https://docs.openstack.org/infra/manual/zuulv3.html Needed-By: I096b406389f610b503649ee8a4b5067d3f2dec5e Change-Id: I5bfa473e265fc1dea79adb98dfc06d7c7058f84c
This commit is contained in:
parent
a7243bc089
commit
7925832f58
19
.zuul.yaml
Normal file
19
.zuul.yaml
Normal file
@ -0,0 +1,19 @@
|
||||
- job:
|
||||
name: heat-templates-check
|
||||
parent: legacy-dsvm-base
|
||||
run: playbooks/devstack/run.yaml
|
||||
post-run: playbooks/devstack/post.yaml
|
||||
timeout: 7500
|
||||
required-projects:
|
||||
- openstack-infra/devstack-gate
|
||||
- openstack/heat
|
||||
- openstack/heat-templates
|
||||
|
||||
- project:
|
||||
name: openstack/heat-templates
|
||||
check:
|
||||
jobs:
|
||||
- heat-templates-check
|
||||
gate:
|
||||
jobs:
|
||||
- heat-templates-check
|
15
playbooks/devstack/post.yaml
Normal file
15
playbooks/devstack/post.yaml
Normal 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
|
54
playbooks/devstack/run.yaml
Normal file
54
playbooks/devstack/run.yaml
Normal file
@ -0,0 +1,54 @@
|
||||
- hosts: all
|
||||
name: job for templates-devstack
|
||||
tasks:
|
||||
|
||||
- name: Ensure legacy 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 heat git://git.openstack.org/openstack/heat
|
||||
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_EXERCISES=0
|
||||
function post_test_hook {
|
||||
cd $BASE/new/heat-templates/tools
|
||||
./post_test_hook.sh
|
||||
}
|
||||
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 }}'
|
@ -1,12 +1,11 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
EXCLUDED_DIRS = ('contrib', 'elements', 'invalid')
|
||||
EXCLUDED_DIRS = ('contrib', 'elements', 'invalid', 'playbooks')
|
||||
|
||||
|
||||
def main(args):
|
||||
@ -20,7 +19,8 @@ def main(args):
|
||||
if excluded in dirs:
|
||||
dirs.remove(excluded)
|
||||
for name in files:
|
||||
if name.endswith((".yaml", ".template")):
|
||||
if name.endswith((".yaml", ".template")
|
||||
) and not name == ".zuul.yaml":
|
||||
got_error = validate(root, name) or got_error
|
||||
sys.exit(int(got_error))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user