blob: c7d6fdc1546bcba7019a4a3bc20e9a0ed3fb728b [file] [log] [blame]
Michael Kutýf0c0aa72015-11-19 21:51:21 +01001cookiecutter-salt-formula
2=========================
Ales Komarek7792c702015-10-19 20:41:02 +02003
Filip Pytloun38c74a32018-01-18 13:03:41 +01004A cookiecutter template for Salt Formula.
Ales Komarek7792c702015-10-19 20:41:02 +02005
Filip Pytloun38c74a32018-01-18 13:03:41 +01006Installation
Michael Kutýf0c0aa72015-11-19 21:51:21 +01007============
Ales Komarek7792c702015-10-19 20:41:02 +02008
Michael Kutýf0c0aa72015-11-19 21:51:21 +01009.. code-block:: bash
Ales Komarek7792c702015-10-19 20:41:02 +020010
Petr Michalec84d25042016-11-15 23:42:12 +010011 pip install cookiecutter
Petr Michalecd1ff7bd2016-07-14 10:43:13 +020012
Filip Pytloun38c74a32018-01-18 13:03:41 +010013 cd cookiecutter
Petr Michalecd1ff7bd2016-07-14 10:43:13 +020014
Filip Pytloun38c74a32018-01-18 13:03:41 +010015 cookiecutter salt-formula
16
17
18Init Test Kitchen configuration
19===============================
20
21Follow the `salt formula testing <https://salt-formulas.readthedocs.io/en/latest/develop/testing-formulas.html>`_ guidelines and
22automated CI in the main `documentation <https://salt-formulas.readthedocs.io/en/latest/develop/testing.html>`_.
23
24To generate ``.kitchen.yml`` for new or existing project:
25
26- install `envtpl`, renders jinja2 templates with shell environment variables
27- install required gems, it depends on drivers configured to be used (docker by default)
28
29.. code-block:: shell
Petr Michalecd1ff7bd2016-07-14 10:43:13 +020030
31 pip install envtpl
Filip Pytloun38c74a32018-01-18 13:03:41 +010032 gem install kitchen-docker kitchen-salt [kitchen-openstack kitchen-vagrant kitchen-inspec busser-serverspec]
Petr Michalecd1ff7bd2016-07-14 10:43:13 +020033
Filip Pytloun38c74a32018-01-18 13:03:41 +010034Once you create your `tests/pillar` structure (required if you want to auto-populate kitchen yaml with test suites)
Petr Michalecd1ff7bd2016-07-14 10:43:13 +020035
Filip Pytloun38c74a32018-01-18 13:03:41 +010036.. code-block:: shell
Petr Michalecd1ff7bd2016-07-14 10:43:13 +020037
Filip Pytloun38c74a32018-01-18 13:03:41 +010038 # cd <formula repository>
39 ../kitchen-init.sh
40
41Instantly, to add kitchen configuration into existing repository:
42
43.. code-block:: shell
44
45 # cd <formula repository>
Filip Pytloun80ff5b02018-01-18 13:28:43 +010046 curl -skL "https://raw.githubusercontent.com/salt-formulas/cookiecutter-salt-formula/master/kitchen-init.sh" | bash -s --
Filip Pytloun38c74a32018-01-18 13:03:41 +010047