Ansible job definitions for Zuul
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

zuul.yaml 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. # Shared jobs that are generally applicable to everyone
  2. # Assumes a 'base' job defined elsewhere
  3. - job:
  4. name: dco-license
  5. description: |
  6. A job to validate all new commits have been signed using --signoff.
  7. run: playbooks/dco-license/run.yaml
  8. nodeset:
  9. nodes: []
  10. - job:
  11. name: unittests
  12. abstract: true
  13. description: |
  14. Perform setup common to all unit test jobs.
  15. This performs basic host and general project setup tasks common
  16. to all types of unit test jobs.
  17. pre-run: playbooks/unittests/pre.yaml
  18. post-run: playbooks/unittests/post.yaml
  19. - job:
  20. name: build-docker-image
  21. description: |
  22. Build a docker image.
  23. .. include:: ../../playbooks/docker-image/README.rst
  24. pre-run: playbooks/docker-image/pre.yaml
  25. run: playbooks/docker-image/run.yaml
  26. - job:
  27. name: upload-docker-image
  28. parent: build-docker-image
  29. description: |
  30. Build and upload a docker image.
  31. .. include:: ../../playbooks/docker-image/README.rst
  32. .. include:: ../../playbooks/docker-image/credentials.rst
  33. post-run: playbooks/docker-image/upload.yaml
  34. - job:
  35. name: promote-docker-image
  36. description: |
  37. Retag a previously-uploaded docker image.
  38. .. include:: ../../playbooks/docker-image/README.rst
  39. .. include:: ../../playbooks/docker-image/credentials.rst
  40. run: playbooks/docker-image/promote.yaml
  41. nodeset:
  42. nodes: []
  43. - job:
  44. name: upload-git-mirror
  45. description: |
  46. Mirrors a tested project repository to a remote git server.
  47. .. zuul:jobvar:: git_mirror_credentials
  48. :type: dict
  49. This is expected to be a Zuul Secret with these keys:
  50. .. zuul:jobvar:: user
  51. SSH user for the remote git repository
  52. .. zuul:jobvar:: host
  53. SSH host for the remote git repository
  54. .. zuul:jobvar:: ssh_key
  55. Literal private key contents.
  56. Should start with something like ``-----BEGIN RSA PRIVATE KEY-----``.
  57. .. zuul:jobvar:: host_key
  58. SSH host key of the remote git server.
  59. Can be obtained with ``ssh-keyscan -H <host>``.
  60. .. zuul:jobvar:: git_mirror_repository
  61. Path of the remote git repository
  62. run: playbooks/upload-git-mirror/run.yaml
  63. - job:
  64. name: tox
  65. parent: unittests
  66. description: |
  67. Base job containing setup and teardown for tox-based test jobs.
  68. This performs basic host and general project setup tasks common
  69. to all tox unit test jobs.
  70. Responds to these variables:
  71. .. zuul:jobvar:: tox_envlist
  72. Use the specified tox environments (``ALL`` selects all).
  73. .. zuul:jobvar:: tox_environment
  74. List of user defined environmental variables to pass to bash
  75. shell.
  76. .. zuul:jobvar:: tox_extra_args
  77. String containing extra arguments to append to the tox command line.
  78. .. zuul:jobvar: tox_constraints_file
  79. Path to a pip constraints file. Will be provided to tox in the
  80. UPPER_CONSTRAINTS_FILE environment variable if it exists.
  81. .. zuul:jobvar: tox_install_siblings
  82. :default: true
  83. Override tox requirements that have corresponding zuul git repos
  84. on the node by installing the git versions into the tox virtualenv.
  85. .. zuul:jobvar: tox_install_bindep
  86. :default: true
  87. Whether or not to run the binary dependencies detection and
  88. installation with bindep.
  89. run: playbooks/tox/run.yaml
  90. pre-run: playbooks/tox/pre.yaml
  91. post-run: playbooks/tox/post.yaml
  92. vars:
  93. tox_environment:
  94. NOSE_WITH_HTML_OUTPUT: 1
  95. NOSE_HTML_OUT_FILE: nose_results.html
  96. NOSE_WITH_XUNIT: 1
  97. - job:
  98. name: tox-py27
  99. parent: tox
  100. description: |
  101. Run unit tests for a Python project under cPython version 2.7.
  102. Uses tox with the ``py27`` environment.
  103. vars:
  104. tox_envlist: py27
  105. - job:
  106. name: tox-py34
  107. parent: tox
  108. description: |
  109. Run unit tests for a Python project under cPython version 3.4.
  110. Uses tox with the ``py34`` environment.
  111. vars:
  112. tox_envlist: py34
  113. - job:
  114. name: tox-py35
  115. parent: tox
  116. description: |
  117. Run unit tests for a Python project under cPython version 3.5.
  118. Uses tox with the ``py35`` environment.
  119. vars:
  120. tox_envlist: py35
  121. - job:
  122. name: tox-py36
  123. parent: tox
  124. description: |
  125. Run unit tests for a Python project under cPython version 3.6.
  126. Uses tox with the ``py36`` environment.
  127. vars:
  128. tox_envlist: py36
  129. - job:
  130. name: tox-py37
  131. parent: tox
  132. description: |
  133. Run unit tests for a Python project under cPython version 3.7.
  134. Uses tox with the ``py37`` environment.
  135. vars:
  136. tox_envlist: py37
  137. - job:
  138. name: tox-docs
  139. # This is not parented to tox since we do not need
  140. # the roles from its parent unittests.
  141. description: |
  142. Run documentation unit tests.
  143. Uses tox with the ``docs`` environment.
  144. vars:
  145. tox_envlist: docs
  146. bindep_profile: compile doc
  147. run: playbooks/tox/run.yaml
  148. pre-run:
  149. - playbooks/tox-docs/pre.yaml
  150. - playbooks/tox/pre.yaml
  151. post-run:
  152. - playbooks/tox/docs-post.yaml
  153. - playbooks/tox/post.yaml
  154. success-url: html/
  155. - job:
  156. name: tox-linters
  157. parent: tox
  158. description: |
  159. Runs code linting tests.
  160. Uses tox with the ``linters`` environment.
  161. vars:
  162. tox_envlist: linters
  163. - job:
  164. name: tox-pep8
  165. parent: tox
  166. description: |
  167. Runs code pep8 tests.
  168. Uses tox with the ``pep8`` environment.
  169. vars:
  170. tox_envlist: pep8
  171. - job:
  172. name: tox-cover
  173. parent: tox
  174. description: |
  175. Run code coverage tests.
  176. Uses tox with the ``cover`` environment.
  177. post-run: playbooks/tox/cover-post.yaml
  178. vars:
  179. tox_envlist: cover
  180. - job:
  181. name: tox-bashate
  182. parent: tox
  183. description: |
  184. Run bashate tests.
  185. Uses tox with the ``bashate`` environment.
  186. vars:
  187. tox_envlist: bashate
  188. - job:
  189. name: tox-nodejs-npm
  190. parent: tox
  191. description: |
  192. Run tests using tox but with the javascript toolchain installed
  193. and available as well. A combination of the tox and nodejs-npm
  194. jobs. By default will run npm before running the tox environment listed.
  195. Responds to these variables:
  196. .. zuul:jobvar:: tox_envlist
  197. Use the specified tox environments (``ALL`` selects all).
  198. .. zuul:jobvar:: tox_environment
  199. List of user defined environmental variables to pass to bash
  200. shell.
  201. .. zuul:jobvar:: tox_extra_args
  202. String containing extra arguments to append to the tox command line.
  203. .. zuul:jobvar: tox_constraints_file
  204. Path to a pip constraints file. Will be provided to tox in the
  205. UPPER_CONSTRAINTS_FILE environment variable if it exists.
  206. .. zuul:jobvar: tox_install_siblings
  207. :default: true
  208. Override tox requirements that have corresponding zuul git repos
  209. on the node by installing the git versions into the tox virtualenv.
  210. .. zuul:jobvar:: npm_command
  211. :default: build
  212. Command to pass to npm.
  213. .. zuul:jobvar:: node_version
  214. :default: 6
  215. The version of Node to use.
  216. .. zuul:jobvar: javascript_content_dir
  217. :default: dist
  218. Directory, relative to zuul_work_dir, holding build content.
  219. .. zuul:jobvar: zuul_work_dir
  220. :default: {{ zuul.project.src_dir }}
  221. Path to operate in.
  222. pre-run: playbooks/javascript/pre.yaml
  223. run: playbooks/tox/npm.yaml
  224. post-run: playbooks/javascript/post.yaml
  225. vars:
  226. npm_command: build
  227. - job:
  228. name: build-python-release
  229. description: |
  230. Build a source tarball and a bdist wheel for uploading.
  231. run: playbooks/python/release.yaml
  232. post-run: playbooks/python/tarball-post.yaml
  233. - job:
  234. name: python-upload-pypi
  235. parent: build-python-release
  236. description: |
  237. Generate and upload a python source tarball and binary wheel
  238. Requires a variable ``pypi_info`` be set which is a dict containing
  239. at least a ``username`` and ``password`` attribute.
  240. post-run: playbooks/python/upload-pypi.yaml
  241. - job:
  242. name: build-sphinx-docs
  243. description: |
  244. Build documentation using Sphinx
  245. Additional requirements can be provided in a project in either the
  246. file ``doc/requirements.txt`` or ``test-requirements.txt``. (The first
  247. file found in that order will be the one used) Non-python distro
  248. requirements can be specified in ``bindep.txt`` using the ``doc`` tag.
  249. Runs `whereto https://docs.openstack.org/whereto/latest/` after the build
  250. if it is installed.
  251. Responds to these variables:
  252. .. zuul:jobvar:: constraints_file
  253. Optional path to a pip constraints file for installing python
  254. libraries.
  255. .. zuul:jobvar:: sphinx_python
  256. :default: python2
  257. Version of python to use, either ``python2`` or ``python3``.
  258. .. zuul:jobvar:: zuul_work_dir
  259. :default: {{ zuul.project.src_dir }}
  260. Directory to operate in.
  261. success-url: html/
  262. pre-run: playbooks/sphinx/pre.yaml
  263. run: playbooks/sphinx/run.yaml
  264. post-run: playbooks/sphinx/post.yaml
  265. - job:
  266. name: build-reno-releasenotes
  267. description: |
  268. Build releasenotes using reno
  269. Additional requirements can be provided in a project in either the
  270. file ``doc/requirements.txt`` or ``test-requirements.txt``. (The first
  271. file found in that order will be the one used) Non-python distro
  272. requirements can be specified in ``bindep.txt`` using the ``doc`` tag.
  273. Responds to these variables:
  274. .. zuul:jobvar:: constraints_file
  275. Optional path to a pip constraints file for installing python
  276. libraries.
  277. .. zuul:jobvar:: sphinx_python
  278. :default: python2
  279. Version of python to use, either ``python2`` or ``python3``.
  280. .. zuul:jobvar:: zuul_work_dir
  281. :default: {{ zuul.project.src_dir }}
  282. Directory to operate in.
  283. success-url: html/
  284. # Release notes always build on master.
  285. override-checkout: master
  286. pre-run: playbooks/releasenotes/pre.yaml
  287. run: playbooks/releasenotes/run.yaml
  288. post-run: playbooks/releasenotes/post.yaml
  289. files:
  290. - ^releasenotes/.*
  291. - bindep.txt
  292. - doc/requirements.txt
  293. - test-requirements.txt
  294. - tox.ini
  295. - job:
  296. name: multinode
  297. abstract: true
  298. description: |
  299. Do additional setup needed for multi-node jobs such as setting up
  300. overlay networks and setting up known-hosts and ssh keys
  301. pre-run: playbooks/multinode/pre.yaml
  302. - job:
  303. name: nodejs-npm
  304. parent: unittests
  305. description: |
  306. Base job for javascript operations
  307. Responds to these variables:
  308. .. zuul:jobvar:: npm_command
  309. :default: build
  310. Command to pass to npm.
  311. .. zuul:jobvar:: node_version
  312. :default: 6
  313. The version of Node to use.
  314. .. zuul:jobvar: zuul_work_dir
  315. :default: {{ zuul.project.src_dir }}
  316. Path to operate in.
  317. .. zuul:jobvar: javascript_content_dir
  318. :default: dist
  319. Directory, relative to zuul_work_dir, holding build content.
  320. pre-run: playbooks/javascript/pre.yaml
  321. run: playbooks/javascript/run.yaml
  322. post-run: playbooks/javascript/post.yaml
  323. vars:
  324. npm_command: build
  325. - job:
  326. name: build-javascript-tarball
  327. parent: nodejs-npm
  328. description: |
  329. Build a source tarball for a Javascript project
  330. Responds to these variables:
  331. .. zuul:jobvar:: node_version
  332. :default: 6
  333. The version of Node to use.
  334. .. zuul:jobvar: zuul_work_dir
  335. :default: {{ zuul.project.src_dir }}
  336. Path to operate in.
  337. .. zuul:jobvar: javascript_content_dir
  338. :default: dist
  339. Directory, relative to zuul_work_dir, holding build content.
  340. vars:
  341. npm_command: pack
  342. - job:
  343. name: build-javascript-content
  344. parent: nodejs-npm
  345. description: |
  346. Build javascript web content as it should be deployed.
  347. Responds to these variables:
  348. .. zuul:jobvar:: npm_command
  349. :default: build
  350. Command to pass to npm.
  351. .. zuul:jobvar:: node_version
  352. :default: 6
  353. The version of Node to use.
  354. .. zuul:jobvar: zuul_work_dir
  355. :default: {{ zuul.project.src_dir }}
  356. Path to operate in.
  357. .. zuul:jobvar: javascript_content_dir
  358. :default: dist
  359. Directory, relative to zuul_work_dir, holding build content.
  360. success-url: npm/html/
  361. - job:
  362. name: nodejs-npm-run-test
  363. parent: nodejs-npm
  364. description: |
  365. Run test using nodejs. This test also starts Xvfb for run time
  366. tests.
  367. Responds to these variables:
  368. .. zuul:jobvar:: node_version
  369. :default: 6
  370. The version of Node to use.
  371. .. zuul:jobvar: zuul_work_dir
  372. :default: {{ zuul.project.src_dir }}
  373. Path to operate in.
  374. .. zuul:jobvar: javascript_content_dir
  375. :default: dist
  376. Directory, relative to zuul_work_dir, holding build content.
  377. pre-run: playbooks/javascript/pre-test.yaml
  378. vars:
  379. npm_command: test
  380. - job:
  381. name: nodejs-npm-run-lint
  382. parent: nodejs-npm
  383. description: |
  384. Run lint using nodejs.
  385. Responds to these variables:
  386. .. zuul:jobvar:: node_version
  387. :default: 6
  388. The version of Node to use.
  389. .. zuul:jobvar: zuul_work_dir
  390. :default: {{ zuul.project.src_dir }}
  391. Path to operate in.
  392. .. zuul:jobvar: javascript_content_dir
  393. :default: dist
  394. Directory, relative to zuul_work_dir, holding build content.
  395. vars:
  396. npm_command: lint
  397. - job:
  398. name: nodejs-npm-run-docs
  399. parent: nodejs-npm
  400. description: |
  401. Run docs using nodejs.
  402. Responds to these variables:
  403. .. zuul:jobvar:: node_version
  404. :default: 6
  405. The version of Node to use.
  406. .. zuul:jobvar: zuul_work_dir
  407. :default: {{ zuul.project.src_dir }}
  408. Path to operate in.
  409. post-run: playbooks/tox/docs-post.yaml
  410. success-url: html/
  411. vars:
  412. npm_command: docs
  413. - job:
  414. name: run-test-command
  415. parent: unittests
  416. description: |
  417. Run simple command as test.
  418. To use this, set the ``test_command`` variable to a single command or
  419. a list of commands. For complex list of commands, it is recommended to
  420. use a single command that run a proper script.
  421. run: playbooks/run-test-command/run.yaml
  422. vars:
  423. test_command: "exit 1"