You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you want to use this formula, please pay attention to the ``FORMULA`` file and/or ``git tag``,
31
+
which contains the currently released version. This formula is versioned according to `Semantic Versioning <http://semver.org/>`_.
32
+
33
+
See `Formula Versioning Section <https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html#versioning>`_ for more details.
34
+
35
+
Contributing to this repo
36
+
-------------------------
37
+
38
+
**Commit message formatting is significant!!**
39
+
40
+
Please see `How to contribute <https://github.com/saltstack-formulas/.github/blob/master/CONTRIBUTING.rst>`_ for more details.
11
41
12
42
Available states
13
-
================
43
+
----------------
14
44
15
45
.. contents::
16
46
:local:
17
47
18
48
``docker``
19
-
----------
49
+
^^^^^^^^^^
20
50
21
51
Install and run Docker daemon
22
52
@@ -30,7 +60,7 @@ Install and run Docker daemon
30
60
31
61
32
62
``docker.containers``
33
-
---------------------
63
+
^^^^^^^^^^^^^^^^^^^^^
34
64
35
65
Pulls and runs a number of docker containers with arbitrary *run* options all configurable via pillars.
36
66
Salt includes *dockerio* and *dockerng* states, but both depend on *docker-py* library, which not always implements the latest *docker run* options. This gives the user more control over the docker run options, but it doesn't try to implement all the other docker commands, such as build, ps, inspect, etc. It just pulls an image and runs it.
@@ -71,34 +101,34 @@ In the example pillar above:
71
101
- ``service <container_name> stop`` will wipeout the container completely (ie ``docker stop <container_name> + docker rm <container_name>``)
72
102
73
103
``docker.clean``
74
-
----------------
104
+
^^^^^^^^^^^^^^^^
75
105
76
106
Stop Docker daemon and remove older docker packages (usually called 'docker' and 'docker-engine'). Linux only.
77
107
78
108
``docker.repo``
79
-
---------------
109
+
^^^^^^^^^^^^^^^
80
110
81
111
Configures the upstream docker's repo (true, by default).
(previously ``fig``) to define groups of containers and their relationships
98
128
with one another. Use `docker.compose-ng` to run `docker-compose`.
99
129
100
130
``docker.compose-ng``
101
-
---------------------
131
+
^^^^^^^^^^^^^^^^^^^^^
102
132
103
133
The intent is to provide an interface similar to the `specification <https://docs.docker.com/compose/compose-file/>`_
104
134
provided by docker-compose. The hope is that you may provide pillar data
@@ -162,7 +192,7 @@ Then you would target a host with the following states:
162
192
163
193
164
194
``docker.registry (DEPRECATED)``
165
-
--------------------------------
195
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
166
196
167
197
NEW:
168
198
@@ -201,32 +231,57 @@ In this case, extra *docker run* options can be provided in your *"registry:look
201
231
By default, the storage backend used by the registry is "filesystem". Use environment variables to override that, for example to use S3 as backend storage.
202
232
203
233
``docker.remove``
204
-
----------------
234
+
^^^^^^^^^^^^^^^^^
205
235
206
236
Stop Docker daemon. Remove older docker packages (usually called 'docker' and 'docker-engine').
207
237
208
238
Development
209
-
===========
239
+
-----------
210
240
211
241
Note that some of the internal states such as `docker.running` are references to the internal `dockerio states <https://docs.saltstack.com/en/latest/ref/states/all/salt.states.dockerio.html>`_
212
242
213
243
214
244
Testing
215
-
=======
245
+
-------
216
246
217
-
Testing is done with `Test Kitchen <http://kitchen.ci/>`_
218
-
for machine setup and `testinfra <https://testinfra.readthedocs.io/en/latest/>`_
219
-
for integration tests.
247
+
Linux testing is done with ``kitchen-salt``.
220
248
221
249
Requirements
222
-
------------
250
+
^^^^^^^^^^^^
223
251
224
-
* Python
225
252
* Ruby
226
253
* Docker
227
254
228
-
::
255
+
.. code-block:: bash
256
+
257
+
$ gem install bundler
258
+
$ bundle install
259
+
$ bin/kitchen test [platform]
260
+
261
+
Where ``[platform]`` is the platform name defined in ``kitchen.yml``,
262
+
e.g. ``debian-9-2019-2-py3``.
263
+
264
+
``bin/kitchen converge``
265
+
^^^^^^^^^^^^^^^^^^^^^^^^
266
+
267
+
Creates the docker instance and runs the ``template`` main state, ready for testing.
268
+
269
+
``bin/kitchen verify``
270
+
^^^^^^^^^^^^^^^^^^^^^^
271
+
272
+
Runs the ``inspec`` tests on the actual instance.
273
+
274
+
``bin/kitchen destroy``
275
+
^^^^^^^^^^^^^^^^^^^^^^^
276
+
277
+
Removes the docker instance.
278
+
279
+
``bin/kitchen test``
280
+
^^^^^^^^^^^^^^^^^^^^
281
+
282
+
Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``verify`` + ``destroy``.
283
+
284
+
``bin/kitchen login``
285
+
^^^^^^^^^^^^^^^^^^^^^
229
286
230
-
gem install bundler
231
-
bundle install
232
-
kitchen test
287
+
Gives you SSH access to the instance for manual testing.
0 commit comments