summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorricolin <rico.lin.guanyu@gmail.com>2020-09-27 19:33:16 +0800
committerricolin <rico.lin.guanyu@gmail.com>2020-10-30 12:39:02 +0800
commitc5733ee95560d6af66511da2ef4dd5cd81c0b956 (patch)
treeee0a0b3e504a70f39d8fff6f170ca0e79c60676f
parent8a20477005a6d9ab1e647597695aefc91328e5ea (diff)
downloadheat-templates-c5733ee95560d6af66511da2ef4dd5cd81c0b956.tar.gz
Move heat-templates-check job to zuul v3
Change-Id: Ie858c406b6a7d973f9632aa98360b7322758fc3a
-rw-r--r--.zuul.yaml49
-rw-r--r--playbooks/devstack/post.yaml15
-rw-r--r--playbooks/devstack/run.yaml63
-rw-r--r--roles/run-heat-template-check/defaults/main.yaml2
-rw-r--r--roles/run-heat-template-check/tasks/main.yaml28
-rwxr-xr-xtools/validate-templates3
6 files changed, 86 insertions, 74 deletions
diff --git a/.zuul.yaml b/.zuul.yaml
index 7674b0e..fa2f64c 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -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:
diff --git a/playbooks/devstack/post.yaml b/playbooks/devstack/post.yaml
deleted file mode 100644
index e07f551..0000000
--- a/playbooks/devstack/post.yaml
+++ /dev/null
@@ -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
diff --git a/playbooks/devstack/run.yaml b/playbooks/devstack/run.yaml
index 1f2bd41..360e120 100644
--- a/playbooks/devstack/run.yaml
+++ b/playbooks/devstack/run.yaml
@@ -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
diff --git a/roles/run-heat-template-check/defaults/main.yaml b/roles/run-heat-template-check/defaults/main.yaml
new file mode 100644
index 0000000..b601d49
--- /dev/null
+++ b/roles/run-heat-template-check/defaults/main.yaml
@@ -0,0 +1,2 @@
+devstack_base_dir: /opt/stack
+tempest_test_timeout: ''
diff --git a/roles/run-heat-template-check/tasks/main.yaml b/roles/run-heat-template-check/tasks/main.yaml
new file mode 100644
index 0000000..ec2699b
--- /dev/null
+++ b/roles/run-heat-template-check/tasks/main.yaml
@@ -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 }}"
diff --git a/tools/validate-templates b/tools/validate-templates
index 9585ca4..7d20b2d 100755
--- a/tools/validate-templates
+++ b/tools/validate-templates
@@ -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)