Move heat-templates-check job to zuul v3

Change-Id: Ie858c406b6a7d973f9632aa98360b7322758fc3a
changes/07/754607/18
ricolin 2 years ago
parent 8a20477005
commit c5733ee955

@ -1,14 +1,51 @@
- job:
name: heat-templates-check
parent: legacy-dsvm-base
parent: devstack
run: playbooks/devstack/run.yaml
post-run: playbooks/devstack/post.yaml
timeout: 7500
required-projects:
- openstack/devstack-gate
- openstack/heat
- openstack/heat-agents
- openstack/heat-templates
- opendev.org/openstack/heat
- opendev.org/openstack/heat-agents
- opendev.org/openstack/heat-templates
roles:
- zuul: opendev.org/openstack/devstack
vars:
devstack_services:
s-account: false
s-container: false
s-object: false
s-proxy: false
devstack_plugins:
heat: https://opendev.org/openstack/heat
devstack_local_conf:
post-config:
$HEAT_CONF:
DEFAULT:
convergence_engine: true
logging_exception_prefix: "%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s"
heat_api:
workers: 2
heat_api_cfn:
workers: 2
cache:
enabled: True
eventlet_opts:
client_socket_timeout: 120
oslo_messaging_notifications:
driver: messagingv2
test_results_stage_name: test_results
zuul_copy_output:
'{{ stage_dir }}/{{ test_results_stage_name }}.subunit': logs
'{{ stage_dir }}/{{ test_results_stage_name }}.html': logs
'{{ stage_dir }}/stackviz': logs
extensions_to_txt:
conf: true
log: true
yaml: true
yml: true
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
- project:
check:

@ -1,15 +0,0 @@
- 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

@ -1,54 +1,11 @@
- 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/devstack-gate
dest: devstack-gate
EOF
/usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \
https://opendev.org \
openstack/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 https://opendev.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 PROJECTS="openstack/heat-agents $PROJECTS"
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 }}'
# This is the default strategy, however since orchestrate-devstack requires
# "linear", it is safer to enforce it in case this is running in an
# environment configured with a different default strategy.
strategy: linear
roles:
- orchestrate-devstack
- hosts: controller
roles:
- run-heat-template-check

@ -0,0 +1,2 @@
devstack_base_dir: /opt/stack
tempest_test_timeout: ''

@ -0,0 +1,28 @@
- name: prepare check env
shell:
cmd: |
set -x
source ${DEVSTACK_BASE_DIR}/devstack/openrc admin admin
source ${DEVSTACK_BASE_DIR}/devstack/functions-common
neutron_service=$(get_or_create_service "neutron" "network" "Neutron Service")
get_or_create_endpoint $neutron_service "$REGION_NAME" "http://localhost"
aodh_service=$(get_or_create_service "aodh" "alarming" "OpenStack Alarming Service")
get_or_create_endpoint $aodh_service "$REGION_NAME" "http://localhost"
mistral_service=$(get_or_create_service "mistral" "workflowv2" "Workflow Service v2")
get_or_create_endpoint $mistral_service "$REGION_NAME" "http://localhost"
senlin_service=$(get_or_create_service "senlin" "clustering" "Senlin Clustering Service")
get_or_create_endpoint $senlin_service "$REGION_NAME" "http://localhost"
monasca_service=$(get_or_create_service "monasca" "monitoring" "Monasca Monitoring Service")
get_or_create_endpoint $monasca_service "$REGION_NAME" "http://localhost"
zaqar_service=$(get_or_create_service "zaqar" "messaging" "Zaqar Service")
get_or_create_endpoint $zaqar_service "$REGION_NAME" "http://localhost"
designate_service=$(get_or_create_service "designate" "dns" "Designate DNS Service")
get_or_create_endpoint $designate_service "$REGION_NAME" "http://localhost"
barbican_service=$(get_or_create_service "barbican" "key-manager" "Barbican Service")
get_or_create_endpoint $barbican_service "$REGION_NAME" "http://localhost"
source ${DEVSTACK_BASE_DIR}/devstack/openrc demo demo
{{ ansible_python.executable }} ${DEVSTACK_BASE_DIR}/heat-templates/tools/validate-templates ${DEVSTACK_BASE_DIR}/heat-templates
executable: /bin/bash
environment:
DEVSTACK_BASE_DIR: "{{ devstack_base_dir }}"

@ -15,6 +15,9 @@ def main(args):
path = args[0]
got_error = False
for root, dirs, files in os.walk(path):
# Skip Zuul scripts
if 'roles/run-heat-template-check' in root:
continue
for excluded in EXCLUDED_DIRS:
if excluded in dirs:
dirs.remove(excluded)

Loading…
Cancel
Save