/
ansible-role-jobs.yaml
147 lines (131 loc) · 4.09 KB
/
ansible-role-jobs.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
- job-template:
name: 'gate-{name}-ansible-lint'
node: 'ubuntu-trusty'
builders:
- zuul-git-prep
- install-distro-packages
- ansible-prep
- ansible-lint-prep
- revoke-sudo
- ansible-syntax
- ansible-lint
publishers:
- console-log
- job-group:
# TODO(pabelanger): Remove in favor of ansible-role-jobs
name: 'ansible-lint-jobs'
jobs:
- 'gate-{name}-ansible-lint'
- job-template:
name: '{pipeline}-{name}-dsvm-ansible-func-{ostype}{suffix}'
node: '{ostype}'
wrappers:
- build-timeout:
timeout: 100
- timestamps
builders:
- print-template-name:
template-name: "{template-name}"
- zuul-git-prep
- devstack-checkout
- shell: |
# Allow Jenkins user to ssh into localhost
ssh-keygen -f ~/.ssh/id_rsa -N ""
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh-keyscan localhost >> ~/.ssh/known_hosts
ssh-keyscan 127.0.0.1 >> ~/.ssh/known_hosts
- shell: |
#!/bin/bash -xe
export PYTHONUNBUFFERED=true
export DEVSTACK_GATE_NEUTRON=1
export PROJECTS="$ZUUL_PROJECT $PROJECTS"
export BRANCH_OVERRIDE={branch-override}
if [ "$BRANCH_OVERRIDE" != "default" ] ; then
export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE
fi
function post_test_hook {{
$BASE/new/{name}/tests/hooks/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
publishers:
- devstack-logs
- console-log
- job-template:
name: '{pipeline}-{name}-ansible-{scenario}-{ostype}{suffix}'
node: '{ostype}'
wrappers:
- build-timeout:
timeout: 60
- timestamps
builders:
- print-template-name:
template-name: "{template-name}"
- zuul-git-prep-upper-constraints
- shell: |
if [[ "{name}" == *"openstack-ansible"* ]]; then
sudo yum-config-manager --enable epel || true
fi
- install-distro-packages
- shell: |
# Allow Jenkins user to ssh into localhost
ssh-keygen -f ~/.ssh/id_rsa -N ""
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh-keyscan localhost >> ~/.ssh/known_hosts
ssh-keyscan 127.0.0.1 >> ~/.ssh/known_hosts
- shell: |
# Many of the Ansible roles have a tox environment
# called 'functional', so we implement a mapping
# of the scenario 'func' to 'functional' so reduce
# the need for code churn in those repositories
# immediately.
if [ "{scenario}" == "func" ]; then
/usr/local/jenkins/slave_scripts/run-tox.sh functional
else
/usr/local/jenkins/slave_scripts/run-tox.sh {scenario}
fi
publishers:
# Although these aren't devstack jobs, we want to capture logs
# similar in nature to devstack (Ansible logs, system logs, etc.)
- devstack-logs
- console-log
- job-group:
name: 'ansible-role-jobs'
node:
- ubuntu-trusty
- ubuntu-xenial
jobs:
- 'gate-{name}-docs-{node}'
- 'gate-{name}-linters-{node}'
- '{pipeline}-{name}-ansible-{scenario}-{ostype}{suffix}':
ostype:
- centos-7
- fedora-25
- ubuntu-trusty
- ubuntu-xenial
pipeline: gate
scenario: func
suffix:
- '-nv'
- ''
- '{name}-announce-release'
- job-group:
name: 'ansible-role-dsvm-jobs'
node:
- ubuntu-trusty
- ubuntu-xenial
jobs:
- 'gate-{name}-docs-{node}'
- 'gate-{name}-linters-{node}'
- '{pipeline}-{name}-dsvm-ansible-func-{ostype}{suffix}':
branch-override: default
ostype:
- centos-7
- ubuntu-trusty
- ubuntu-xenial
pipeline: gate
suffix:
- '-nv'
- ''
- '{name}-announce-release'