diff --git a/.github/workflows/kitchen.yml b/.github/workflows/kitchen.yml index e2e961c3..7320c7a5 100644 --- a/.github/workflows/kitchen.yml +++ b/.github/workflows/kitchen.yml @@ -87,6 +87,10 @@ jobs: # - package-oraclelinux-7-master-py3 # - clean-oraclelinux-7-master-py3 # - oraclelinux-7-master-py3 + # - archive-arch-base-latest-master-py3 + # - package-arch-base-latest-master-py3 + # - clean-arch-base-latest-master-py3 + - arch-base-latest-master-py3 # - archive-gentoo-stage3-latest-master-py3 # - package-gentoo-stage3-latest-master-py3 # - clean-gentoo-stage3-latest-master-py3 @@ -108,9 +112,6 @@ jobs: # - archive-oraclelinux-8-3003-0-py3 # - archive-oraclelinux-7-3003-0-py3 # - archive-arch-base-latest-3003-0-py3 - # - package-arch-base-latest-3003-0-py3 - # - clean-arch-base-latest-3003-0-py3 - - arch-base-latest-3003-0-py3 # - archive-gentoo-stage3-latest-3003-0-py3 # - archive-gentoo-stage3-systemd-3003-0-py3 # - archive-debian-10-3002-6-py3 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ea8271b9..9bc41097 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -52,4 +52,3 @@ repos: - id: rstcheck name: Check reST files using rstcheck exclude: 'docs/CHANGELOG.rst' - args: [--report=warning] diff --git a/.rstcheck.cfg b/.rstcheck.cfg index 05856dc7..5383623e 100644 --- a/.rstcheck.cfg +++ b/.rstcheck.cfg @@ -1,3 +1,4 @@ [rstcheck] -report=error +report=info ignore_language=rst +ignore_messages=(Duplicate (ex|im)plicit target.*|Hyperlink target ".*" is not referenced\.$) diff --git a/AUTHORS.md b/AUTHORS.md index 1deee98b..3476fea7 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -4,14 +4,15 @@ This list is sorted by the number of commits per contributor in _descending_ ord Avatar|Contributor|Contributions :-:|---|:-: -@noelmcloughlin|[@noelmcloughlin](https://github.com/noelmcloughlin)|115 -@myii|[@myii](https://github.com/myii)|67 +@noelmcloughlin|[@noelmcloughlin](https://github.com/noelmcloughlin)|117 +@myii|[@myii](https://github.com/myii)|74 @cdarwin|[@cdarwin](https://github.com/cdarwin)|25 @gravyboat|[@gravyboat](https://github.com/gravyboat)|22 @aboe76|[@aboe76](https://github.com/aboe76)|21 @javierbertoli|[@javierbertoli](https://github.com/javierbertoli)|18 @puneetk|[@puneetk](https://github.com/puneetk)|15 @vladvasiliu|[@vladvasiliu](https://github.com/vladvasiliu)|12 +@danny-smit|[@danny-smit](https://github.com/danny-smit)|9 @nmadhok|[@nmadhok](https://github.com/nmadhok)|9 @ticosax|[@ticosax](https://github.com/ticosax)|7 @alexproca|[@alexproca](https://github.com/alexproca)|6 @@ -61,4 +62,4 @@ Avatar|Contributor|Contributions --- -Auto-generated by a [forked version](https://github.com/myii/maintainer) of [gaocegege/maintainer](https://github.com/gaocegege/maintainer) on 2021-04-23. +Auto-generated by a [forked version](https://github.com/myii/maintainer) of [gaocegege/maintainer](https://github.com/gaocegege/maintainer) on 2021-06-02. diff --git a/CHANGELOG.md b/CHANGELOG.md index 530e8c17..8ef1ece6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,57 @@ # Changelog +## [2.0.7](https://github.com/saltstack-formulas/docker-formula/compare/v2.0.6...v2.0.7) (2021-06-02) + + +### Bug Fixes + +* **clean:** fix syntax error in networks.clean ([89cd4fc](https://github.com/saltstack-formulas/docker-formula/commit/89cd4fccf0109fb37a33a4de762b6a2c5c02bbc2)) + +## [2.0.6](https://github.com/saltstack-formulas/docker-formula/compare/v2.0.5...v2.0.6) (2021-05-21) + + +### Bug Fixes + +* **service:** reload the docker service when daemon.json has changed ([b34f434](https://github.com/saltstack-formulas/docker-formula/commit/b34f434a5ae35ee1fb54b7c542a59d5ba4ab32da)) + +## [2.0.5](https://github.com/saltstack-formulas/docker-formula/compare/v2.0.4...v2.0.5) (2021-05-20) + + +### Bug Fixes + +* **clean:** fix clean of repo for the RedHat family ([4730a72](https://github.com/saltstack-formulas/docker-formula/commit/4730a725c773430674199be99fb8fffe65febfdf)) +* **clean:** fix syntax error in networks.clean state file ([53db7ad](https://github.com/saltstack-formulas/docker-formula/commit/53db7ad8ef775f725b5c339402473d15075174bc)) +* **clean:** fix syntax error with use_upstream repo ([428dccd](https://github.com/saltstack-formulas/docker-formula/commit/428dccdf15c119c32847db0374ff71152157c8a9)) +* **clean:** make repo install and clean states consistent ([af16bb7](https://github.com/saltstack-formulas/docker-formula/commit/af16bb7781da5653c50375c8e197591a2b7d7c09)) +* **clean:** remove invalid 'onlyif' statement from repo.clean ([b3c56cb](https://github.com/saltstack-formulas/docker-formula/commit/b3c56cb9e1784d217eb4cba71caf2a75b0c3a0d4)) +* **clean:** update condition that enables the repo ([1f5190b](https://github.com/saltstack-formulas/docker-formula/commit/1f5190b20c77cfc5be0e9150cce09b46917f7fdd)) +* **clean:** update enable_repo condition to be more robust ([a7f382f](https://github.com/saltstack-formulas/docker-formula/commit/a7f382f3f511b7006f0980efae3db7164ae2a95d)) +* **test:** add missing tests to verify installation from repo ([5a62de9](https://github.com/saltstack-formulas/docker-formula/commit/5a62de91f8afeed3656d939951739c6da3907b9d)) + + +### Continuous Integration + +* **kitchen:** use `master` as default instance for Arch Linux [skip ci] ([161d8cc](https://github.com/saltstack-formulas/docker-formula/commit/161d8cc691eb3dd389cdbce4f3cd54013c3093ed)) + +## [2.0.4](https://github.com/saltstack-formulas/docker-formula/compare/v2.0.3...v2.0.4) (2021-05-19) + + +### Bug Fixes + +* **config:** replace URLs to bintray.com by github.com ([2f60c21](https://github.com/saltstack-formulas/docker-formula/commit/2f60c21fc26dd790c4cb032671a59b477d0197e1)) +* **config:** use 'latest' docker-compose versions from github ([d434e25](https://github.com/saltstack-formulas/docker-formula/commit/d434e2570dbf775b34e2c98d835f9c0378709a63)) + + +### Continuous Integration + +* add `arch-master` to matrix and update `.travis.yml` [skip ci] ([cec557a](https://github.com/saltstack-formulas/docker-formula/commit/cec557abc7dc77a5227852c216047855ab726c57)) + + +### Documentation + +* remove files which aren't formula-specific [skip ci] ([4cc1e70](https://github.com/saltstack-formulas/docker-formula/commit/4cc1e706e4778e1aabef0023da668eaafef8afff)) +* **readme:** fix headings and links [skip ci] ([b0021eb](https://github.com/saltstack-formulas/docker-formula/commit/b0021eb3a379fe8db7bed584fb6ae5d1f060a581)) + ## [2.0.3](https://github.com/saltstack-formulas/docker-formula/compare/v2.0.2...v2.0.3) (2021-04-23) diff --git a/FORMULA b/FORMULA index a6949c5b..d60a308d 100644 --- a/FORMULA +++ b/FORMULA @@ -1,7 +1,7 @@ name: docker os: Debian, Ubuntu, Raspbian, RedHat, Fedora, CentOS, Suse, openSUSE, Gentoo, Funtoo, Arch, Manjaro, Alpine, FreeBSD, OpenBSD, Solaris, SmartOS, Windows, MacOS os_family: Debian, RedHat, Suse, Gentoo, Arch, Alpine, FreeBSD, OpenBSD, Solaris, Windows, MacOS -version: 2.0.3 +version: 2.0.7 release: 1 minimum_version: 2017.7 summary: docker formula diff --git a/docker/defaults.yaml b/docker/defaults.yaml index c81856b2..e7965f52 100644 --- a/docker/defaults.yaml +++ b/docker/defaults.yaml @@ -79,8 +79,8 @@ docker: binary: options: '' # yamllint disable-line rule:line-length - source: 'https://dl.bintray.com/docker-compose/master/docker-compose-Linux-x86_64' - source_hash: '3c96b57ea8e0027aee7e1a3023f7599bcecae54e77bcfd5f4e65a59672637e54' + source: 'https://github.com/docker/compose/releases/latest/download/docker-compose-Linux-x86_64' + source_hash: null networks: {} containers: diff --git a/docker/map.jinja b/docker/map.jinja index 037d03cd..f1ea9baa 100644 --- a/docker/map.jinja +++ b/docker/map.jinja @@ -62,6 +62,7 @@ {%- if 'source_hash' in p.binary and p.binary.source_hash %} {%- do p.binary.update({'name': p.path, 'source_hash': p.binary.source_hash}) %} {%- else %} + {%- set url = p.binary.source %} {%- do p.binary.update({'name': p.path, 'source_hash': url ~ '.sha256'}) %} {%- endif %} diff --git a/docker/networks/clean.sls b/docker/networks/clean.sls index e507f5fc..f9949f8e 100644 --- a/docker/networks/clean.sls +++ b/docker/networks/clean.sls @@ -13,10 +13,11 @@ include: - {{ sls_archive if d.pkg.docker.use_upstream == 'archive' else sls_desktop if d.pkg.docker.use_upstream == 'desktop' else sls_package }} - {%- for name in docker.networks %} + {%- for name in d.networks %} {{ formula }}-network-{{ name }}-absent: docker_network.absent: - name: {{ name }} {%- endfor %} + {%- endif %} diff --git a/docker/osfamilymap.yaml b/docker/osfamilymap.yaml index f9f7e127..eedb872c 100644 --- a/docker/osfamilymap.yaml +++ b/docker/osfamilymap.yaml @@ -59,6 +59,7 @@ RedHat: docker: # environ_file: /etc/sysconfig/docker repo: + name: docker-ce baseurl: 'https://download.docker.com/linux/{{ grains.os|lower }}/$releasever/$basearch/stable' file: '/etc/yum.repos.d/docker-ce.repo' gpgkey: 'https://download.docker.com/linux/{{ grains.os|lower }}/gpg' @@ -95,8 +96,8 @@ MacOS: name: docker-compose # homebrew use_upstream: package # Docker Desktop archive: - source: 'https://dl.bintray.com/docker-compose/master/docker-compose-Darwin-x86_64' - source_hash: 'c5e326611efa45cbaf5b338bf352cbf27e9eb7dff0619f77639cae1158f6571f' + source: 'https://github.com/docker/compose/releases/latest/download/docker-compose-Darwin-x86_64' + source_hash: null Windows: div: '\' diff --git a/docker/software/package/clean.sls b/docker/software/package/clean.sls index f4829d20..3183637b 100644 --- a/docker/software/package/clean.sls +++ b/docker/software/package/clean.sls @@ -6,19 +6,21 @@ {%- set formula = d.formula %} {%- if d.pkg.docker.use_upstream in ('package', 'repo') %} - {%- if grains.kernel|lower in ('linux',) %} - {%- if d.pkg.docker.use_upstream == 'repo' %} + {%- set enable_repo = grains.os_family in ('RedHat', 'Debian') and d.pkg.docker.get('repo') %} + {%- if enable_repo %} + {%- set sls_repo_clean = tplroot ~ '.software.package.repo.clean' %} include: - - .package.repo.clean - {%- endif %} + - {{ sls_repo_clean }} + {%- endif %} + {%- if grains.kernel|lower in ('linux', 'darwin') %} {{ formula }}-software-package-clean-pkg: pkg.removed: - name: {{ d.pkg.docker.name }} - reload_modules: {{ d.misc.reload|default(true, true) }} - {%- if d.pkg.docker.use_upstream == 'repo' %} + {%- if enable_repo %} - require: - - pkgrepo: {{ formula }}-package-repo-absent + - pkgrepo: {{ formula }}-software-package-repo-absent {%- endif %} {%- elif grains.os_family == 'MacOS' %} diff --git a/docker/software/package/install.sls b/docker/software/package/install.sls index 6e232a7f..cf43eb91 100644 --- a/docker/software/package/install.sls +++ b/docker/software/package/install.sls @@ -6,13 +6,14 @@ {%- set formula = d.formula %} {%- if d.pkg.docker.use_upstream in ('package', 'repo') %} + {%- set enable_repo = grains.os_family in ('RedHat', 'Debian') and d.pkg.docker.get('repo') %} {%- set docker_pkg_version = d.version | default(d.pkg.version, true) %} - {%- if grains.os_family in ('RedHat', 'Debian') %} + {%- if enable_repo %} {%- set sls_repo_install = tplroot ~ '.software.package.repo.install' %} - include: - {{ sls_repo_install }} {%- endif %} + {%- if grains.kernel|lower in ('linux', 'darwin') %} {%- if 'deps' in d.pkg and d.pkg.deps %} @@ -43,7 +44,7 @@ include: {%- if grains.os|lower not in ('suse',) %} - hold: {{ d.misc.hold|default(false, true) }} {%- endif %} - {%- if grains.os_family in ('RedHat', 'Debian') %} + {%- if enable_repo %} - require: - pkgrepo: {{ formula }}-software-package-repo-managed {%- endif %} diff --git a/docker/software/package/repo/clean.sls b/docker/software/package/repo/clean.sls index 253d8293..53c03245 100644 --- a/docker/software/package/repo/clean.sls +++ b/docker/software/package/repo/clean.sls @@ -5,8 +5,10 @@ {%- from tplroot ~ "/map.jinja" import data as d with context %} {%- set formula = d.formula %} + {%- if 'repo' in d.pkg.docker and d.pkg.docker.repo %} + {{ formula }}-software-package-repo-absent: pkgrepo.absent: - name: {{ d.pkg.docker.repo.name }} - - onlyif: - - {{ d.pkg.docker.repo }} + + {%- endif %} diff --git a/docker/software/package/repo/install.sls b/docker/software/package/repo/install.sls index c792721e..422b274e 100644 --- a/docker/software/package/repo/install.sls +++ b/docker/software/package/repo/install.sls @@ -13,7 +13,5 @@ {{- format_kwargs(d.pkg.docker.repo) }} - humanname: {{ grains["os"] }} {{ grains["oscodename"]|capitalize }} Docker Package Repository - refresh: {{ d.misc.refresh }} - - onlyif: - - {{ d.pkg.docker.repo }} {%- endif %} diff --git a/docker/software/service/running.sls b/docker/software/service/running.sls index a647c9ea..2823a4d7 100644 --- a/docker/software/service/running.sls +++ b/docker/software/service/running.sls @@ -6,6 +6,7 @@ {%- set formula = d.formula %} {%- if 'service' in d.pkg.docker and d.pkg.docker.service and grains.os != 'Windows' %} + {%- set sls_config_daemon = tplroot ~ '.software.config.daemon' %} {%- set sls_config_file = tplroot ~ '.software.config.file' %} {%- set sls_archive = tplroot ~ '.software.archive.install' %} {%- set sls_desktop = tplroot ~ '.software.desktop.install' %} @@ -14,6 +15,7 @@ include: - {{ sls_archive if d.pkg.docker.use_upstream == 'archive' else sls_desktop if d.pkg.docker.use_upstream == 'desktop' else sls_package }} - {{ sls_config_file }} + - {{ sls_config_daemon }} {%- if grains.kernel|lower == 'linux' %} @@ -23,8 +25,9 @@ include: - onlyif: systemctl list-unit-files | grep {{ d.pkg.docker.service.name }} >/dev/null 2>&1 - require_in: - service: {{ formula }}-software-service-running-docker - {%- if 'config' in d.pkg.docker and d.pkg.docker.config %} - require: + - sls: {{ sls_config_daemon }} + {%- if 'config' in d.pkg.docker and d.pkg.docker.config %} - sls: {{ sls_config_file }} {%- endif %} {%- if d.misc.firewall %} @@ -38,11 +41,15 @@ include: {{ formula }}-software-service-running-docker: service.running: - name: {{ d.pkg.docker.service.name }} - {%- if 'config' in d.pkg.docker and d.pkg.docker.config %} - require: + - sls: {{ sls_config_daemon }} + {%- if 'config' in d.pkg.docker and d.pkg.docker.config %} - sls: {{ sls_config_file }} {%- endif %} - enable: True + - watch: + - file: {{ formula }}-software-daemon-file-managed-daemon_file + {%- if grains.kernel|lower == 'linux' %} {{ formula }}-software-service-running-docker-fail-notify: diff --git a/docs/AUTHORS.rst b/docs/AUTHORS.rst index e97970e9..baa727bb 100644 --- a/docs/AUTHORS.rst +++ b/docs/AUTHORS.rst @@ -15,10 +15,10 @@ This list is sorted by the number of commits per contributor in *descending* ord - Contributions * - :raw-html-m2r:`@noelmcloughlin` - `@noelmcloughlin `_ - - 115 + - 117 * - :raw-html-m2r:`@myii` - `@myii `_ - - 67 + - 74 * - :raw-html-m2r:`@cdarwin` - `@cdarwin `_ - 25 @@ -37,6 +37,9 @@ This list is sorted by the number of commits per contributor in *descending* ord * - :raw-html-m2r:`@vladvasiliu` - `@vladvasiliu `_ - 12 + * - :raw-html-m2r:`@danny-smit` + - `@danny-smit `_ + - 9 * - :raw-html-m2r:`@nmadhok` - `@nmadhok `_ - 9 @@ -179,4 +182,4 @@ This list is sorted by the number of commits per contributor in *descending* ord ---- -Auto-generated by a `forked version `_ of `gaocegege/maintainer `_ on 2021-04-23. +Auto-generated by a `forked version `_ of `gaocegege/maintainer `_ on 2021-06-02. diff --git a/docs/CHANGELOG.rst b/docs/CHANGELOG.rst index 0575b8c5..e08b69d6 100644 --- a/docs/CHANGELOG.rst +++ b/docs/CHANGELOG.rst @@ -2,6 +2,69 @@ Changelog ========= +`2.0.7 `_ (2021-06-02) +-------------------------------------------------------------------------------------------------------- + +Bug Fixes +^^^^^^^^^ + + +* **clean:** fix syntax error in networks.clean (\ `89cd4fc `_\ ) + +`2.0.6 `_ (2021-05-21) +-------------------------------------------------------------------------------------------------------- + +Bug Fixes +^^^^^^^^^ + + +* **service:** reload the docker service when daemon.json has changed (\ `b34f434 `_\ ) + +`2.0.5 `_ (2021-05-20) +-------------------------------------------------------------------------------------------------------- + +Bug Fixes +^^^^^^^^^ + + +* **clean:** fix clean of repo for the RedHat family (\ `4730a72 `_\ ) +* **clean:** fix syntax error in networks.clean state file (\ `53db7ad `_\ ) +* **clean:** fix syntax error with use_upstream repo (\ `428dccd `_\ ) +* **clean:** make repo install and clean states consistent (\ `af16bb7 `_\ ) +* **clean:** remove invalid 'onlyif' statement from repo.clean (\ `b3c56cb `_\ ) +* **clean:** update condition that enables the repo (\ `1f5190b `_\ ) +* **clean:** update enable_repo condition to be more robust (\ `a7f382f `_\ ) +* **test:** add missing tests to verify installation from repo (\ `5a62de9 `_\ ) + +Continuous Integration +^^^^^^^^^^^^^^^^^^^^^^ + + +* **kitchen:** use ``master`` as default instance for Arch Linux [skip ci] (\ `161d8cc `_\ ) + +`2.0.4 `_ (2021-05-19) +-------------------------------------------------------------------------------------------------------- + +Bug Fixes +^^^^^^^^^ + + +* **config:** replace URLs to bintray.com by github.com (\ `2f60c21 `_\ ) +* **config:** use 'latest' docker-compose versions from github (\ `d434e25 `_\ ) + +Continuous Integration +^^^^^^^^^^^^^^^^^^^^^^ + + +* add ``arch-master`` to matrix and update ``.travis.yml`` [skip ci] (\ `cec557a `_\ ) + +Documentation +^^^^^^^^^^^^^ + + +* remove files which aren't formula-specific [skip ci] (\ `4cc1e70 `_\ ) +* **readme:** fix headings and links [skip ci] (\ `b0021eb `_\ ) + `2.0.3 `_ (2021-04-23) -------------------------------------------------------------------------------------------------------- diff --git a/docs/CONTRIBUTING_DOCS.rst b/docs/CONTRIBUTING_DOCS.rst deleted file mode 100644 index 5b59b298..00000000 --- a/docs/CONTRIBUTING_DOCS.rst +++ /dev/null @@ -1,96 +0,0 @@ -.. _contributing_docs: - -Contributing documentation -========================== - -|docs| - -.. |docs| image:: https://readthedocs.org/projects/docs/badge/?version=latest - :alt: Documentation Status - :scale: 100% - :target: https://template-formula.readthedocs.io/en/latest/?badge=latest - -Toolchain -^^^^^^^^^ - -The documentation for this formula is written in -`reStructuredText `_ -(also known as RST, ReST, or reST). -It is built by -`Sphinx `_ -and hosted on -`Read the Docs `_. - -Adding a new page -^^^^^^^^^^^^^^^^^ - -Adding a new page involves two steps: - -#. Use the - :ref:`provided page template ` - to create a new page. -#. Add the page name under the ``toctree`` list in ``index.rst``. - - a. Do not just append it to the list. - #. Select the best place where it fits within the overall documentation. - -SaltStack-Formulas' RST page template -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. _saltstack_formulas_rst_page_template - -Use the following template when creating a new page. -This ensures consistency across the documentation for this formula. -The heading symbols have been selected in accordance to the output rendered by the -`Markdown to reStructuredText converter `_ -we are using for some of the pages of this documentation. - -.. code-block:: rst - - .. _template: - - [Page title] - ============ - - [Introductory paragraph] - - .. contents:: **Table of Contents** - - [Heading 2] - ----------- - - [Heading 3] - ^^^^^^^^^^^ - - [Heading 4] - ~~~~~~~~~~~ - - [Heading 5] - """"""""""" - - [Heading 6] - ########### - -#. The first line is an anchor that can be used to link back to (the top of) - this file. - - a. Change this to be the lowercase version of the file name. - #. Do not include the ``.rst`` file extension. - #. Use hyphens (``-``) instead of spaces or non-letter characters. - -#. Change the ``[Page title]`` accordingly, matching the same number of equals - signs (``=``) underneath. -#. Change the ``[Introductory paragraph]`` to be a short summary of the page - content. - Use no more than three paragraphs for this. -#. Leave the ``..contents:: **Table of Contents**`` line as it is. -#. Use the remaining headings as required to break up the page content. - - a. You will rarely need to use beyond ``[Heading 4]``. - #. Again, no single heading should have more than about three paragraphs of - content before the next heading or sub-heading is used. - -Obviously, it is not necessary to follow the steps in the order above. -For example, it is usually easier to write the ``[Introductory paragraph]`` -at the end. - diff --git a/docs/index.rst b/docs/index.rst deleted file mode 100644 index a49c0c3f..00000000 --- a/docs/index.rst +++ /dev/null @@ -1,20 +0,0 @@ -.. _index: - -.. ``template-formula`` documentation master file. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to template-formula's documentation! -============================================ - -.. toctree:: - :maxdepth: 2 - :caption: Contents - :numbered: - :glob: - - README - CONTRIBUTING - TOFS_pattern - AUTHORS - CHANGELOG diff --git a/kitchen.yml b/kitchen.yml index 7929640b..21217215 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -632,6 +632,23 @@ suites: verifier: inspec_tests: - path: test/integration/package + - name: repo + provisioner: + state_top: + base: + '*': + - docker._mapdata + - docker + pillars: + top.sls: + base: + '*': + - docker + pillars_from_files: + docker.sls: test/salt/pillar/repo.sls + verifier: + inspec_tests: + - path: test/integration/package - name: clean provisioner: state_top: @@ -645,7 +662,7 @@ suites: '*': - docker pillars_from_files: - docker.sls: test/salt/pillar/archive.sls + docker.sls: test/salt/pillar/repo.sls verifier: inspec_tests: - path: test/integration/clean diff --git a/test/salt/pillar/repo.sls b/test/salt/pillar/repo.sls new file mode 100644 index 00000000..dd721dd3 --- /dev/null +++ b/test/salt/pillar/repo.sls @@ -0,0 +1,166 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +--- +# example docker registry container +# if you want to your own docker registry, use this +docker: + wanted: + - docker + - compose + + pkg: + docker: + use_upstream: repo + config: + # yamllint disable-line rule:line-length + - OPTIONS='-s devicemapper --storage-opt dm.fs=xfs --exec-opt native.cgroupdriver=cgroupfs --selinux-enabled' + # yamllint disable-line rule:line-length + - DOCKER_OPTS="-s btrfs --dns 8.8.8.8" + - export http_proxy="http://172.17.42.1:3128" + daemon_config: + insecure-registries: [] + + containers: + running: + - nginx + - prometheus + + nginx: + image: "nginx:latest" + + prometheus: + image: "prom/prometheus:v1.7.1" + env: + - a=b + - ping=pong + - ding=dong + command: + - ls + - ls -l + auto_remove: true + blkio_weight: 1000 + cap_add: ["SYS_ADMIN", "MKNOD"] + dns: + - 8.8.8.8 + - 8.8.4.4 + dns_search: + - EXAMPLE.COM + domainname: + - EXAMPLE.COM + entrypoint: + - ls + - ls -l + - ls -last + - sleep 100 + init: false + labels: + - label1 + - label2 + - label3 + mem_limit: 1g + mem_swappiness: 50 + name: prometheus + network_disabled: false + network_mode: host # bridge or none or container:netcontainer or host + oom_kill_disable: true + oom_score_adj: 100 + pid_mode: host + pids_limit: -1 + privileged: false + publish_all_ports: true + read_only: false + stdin_open: false + tty: true + volume_driver: local + + registry: + image: "registry:latest" + env: + - REGISTRY_LOG_LEVEL=warn + - REGISTRY_STORAGE=s3 + - REGISTRY_STORAGE_S3_REGION=us-west-1 + - REGISTRY_STORAGE_S3_BUCKET=my-bucket + - REGISTRY_STORAGE_S3_ROOTDIRECTORY=/registry + command: + - "--log-driver=syslog" + - "-p 5000:5000" + - "--rm" + + compose: + ## salt dockercompose module ## + applications: + - composetest + composetest: + path: /srv/salt/docker/files/composetest/docker-compose.yml + + ## formerly compose-ng state ## + ng: + registry-datastore: + dvc: true + # image: ®istry_image 'docker.io/registry:latest' ## Fedora + image: ®istry_image 'registry:latest' + container_name: &dvc 'registry-datastore' + command: echo *dvc data volume container + volumes: + - &datapath '/registry' + registry-service: + image: *registry_image + container_name: 'registry-service' + volumes_from: + - *dvc + environment: + SETTINGS_FLAVOR: 'local' + STORAGE_PATH: *datapath + SEARCH_BACKEND: 'sqlalchemy' + REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: '/registry' + ports: + - 127.0.0.1:5000:5000 + # restart: 'always' # compose v1.9 + deploy: # compose v3 + restart_policy: + condition: on-failure + delay: 5s + max_attempts: 3 + window: 120s + nginx-latest: + # image: 'docker.io/nginx:latest' ##Fedora + image: 'nginx:latest' + container_name: 'nginx-latest' + links: + - 'registry-service:registry' + ports: + - '80:80' + - '443:443' + volumes: + - /srv/docker-registry/nginx/:/etc/nginx/conf.d + - /srv/docker-registry/auth/:/etc/nginx/conf.d/auth + - /srv/docker-registry/certs/:/etc/nginx/conf.d/certs + working_dir: '/var/www/html' + volume_driver: 'local' + userns_mode: 'host' + user: 'nginx' + # restart: 'always' # compose v1.9 + deploy: # compose v3 + restart_policy: + condition: on-failure + delay: 5s + max_attempts: 3 + window: 120s + + swarm: + # Per https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.swarm.html + joinswarm: {} + leave_swarm: false + node_ls: {} + remove_node: {} + remove_service: {} + service_create: {} + swarm_init: {} + service_info: {} + swarm_tokens: true + update_node: {} + + misc: + skip_translate: ports + force_present: false + force_running: true