Merge "Use Chef Delivery to run verification tests"

This commit is contained in:
Zuul 2018-07-13 13:57:48 +00:00 committed by Gerrit Code Review
commit d671d4f484
4 changed files with 29 additions and 5 deletions

9
.delivery/project.toml Normal file
View File

@ -0,0 +1,9 @@
[local_phases]
unit = 'berks vendor cookbooks'
lint = 'cookstyle --display-cop-names --extra-details'
syntax = "./scripts/json_check.sh"
provision = "echo skipping"
deploy = "echo skipping"
smoke = "echo skipping"
functional = "echo skipping"
cleanup = "echo skipping"

View File

@ -1,10 +1,10 @@
- job:
name: openstack-chef-repo-rake
name: openstack-chef-repo-delivery
parent: base
description: Run rake tests with openstack-chef-repo
description: Run Chef Delivery tests with openstack-chef-repo
required-projects: openstack/openstack-chef-repo
pre-run: playbooks/pre.yaml
run: playbooks/rake.yaml
run: playbooks/delivery.yaml
timeout: 2700
- job:
@ -21,11 +21,11 @@
name: openstack-chef-repo-jobs
check:
jobs:
- openstack-chef-repo-rake
- openstack-chef-repo-delivery
- openstack-chef-repo-integration
gate:
jobs:
- openstack-chef-repo-rake
- openstack-chef-repo-delivery
- openstack-chef-repo-integration
- project:

8
playbooks/delivery.yaml Normal file
View File

@ -0,0 +1,8 @@
- hosts: all
roles:
- revoke-sudo
tasks:
- name: run delivery local
shell:
cmd: chef exec delivery local all
chdir: '{{ zuul.project.src_dir }}'

7
scripts/json_check.sh Executable file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
# check data bags, roles, environment files sanity by loading them in
# chef-zero
for db in $(ls -d data_bags/* | cut -f2 -d'/');do knife data bag from file $db data_bags/$db/*.json -z --secret-file .chef/encrypted_data_bag_secret;done
for role in $(ls roles | grep json);do knife role from file $role -z;done
for env in $(ls environments | grep json);do knife environment from file $env -z ;done