Skip to content

Commit

Permalink
Update to master branch (#1)
Browse files Browse the repository at this point in the history
* passing the hold and allow_updated to docker pkg.installed

* accessing correct level of config

* Fix rendering error on MacOS ('oscodename')

* Docker is brew name

* No upstart/sysv on Darwin

* chore(python): use python3 apt packages

* fix(syntax): param 'refresh' replaces 'refresh_db'

* Using the tplroot method (borrowed from the ufw-formula) prevents having to set --extra-filerefs when using the formula with salt-ssh.

* Updating apt (ubuntu/debian) resulted in the following error:

Skipping acquire of configured file 'stable/binary-i386/Packages' as repository 'https://download.docker.com/linux/ubuntu bionic InRelease' doesn't support architecture 'i386'

Adding [arch=<osarch>] between deb and https solved this problem.

* Updating apt (ubuntu/debian) resulted in the following error:

Skipping acquire of configured file 'stable/binary-i386/Packages' as repository 'https://download.docker.com/linux/ubuntu bionic InRelease' doesn't support architecture 'i386'

Adding [arch=<osarch>] between deb and https solved this problem.

* Revert "Make it easier when using salt-ssh"

* Use tpldir to make imports work from e.g. salt-ssh without having to resort to --extra-filerefs=salt://docker/map.jinja,... on the cmd line.

Also added the os architecture to the apt sources.list line: deb [arch=<osarch>] http://...

* fix(sls): avoid unnecessary rendering error

* doc(clean): make remove alias for clean

* fix(merge): workaround broken map.jinja merge

* chore(template): align osmap with  template-formula

* feat(macos): docker desktop for mac support

* doc(clean): make remove alias for clean

* chore(template): align osmap with  template-formula

* feat(macos): docker desktop for mac support

* pillar.example registry-mirrors

* fix(install): resolve saltstack-formulas#224

* refactor(init): remove duplicated jinja

* Update docker/install.sls

Co-Authored-By: Imran Iqbal <myii@users.noreply.github.com>

* feat(linux): archlinux support (saltstack-formulas#229)

* feat(semantic-release): implement for this formula

* Semi-automated using myii/ssf-formula#78
* Fix (or ignore) `yamllint` errors:

```bash
docker-formula$ yamllint -s .
./pillar.example
  5:1       warning  missing document start "---"  (document-start)
  10:8      warning  missing starting space in comment  (comments)
  12:11     error    empty value in block mapping  (empty-values)
  13:89     error    line too long (92 > 88 characters)  (line-length)
  14:26     warning  truthy value should be one of [false, true]  (truthy)
  28:1      error    trailing spaces  (trailing-spaces)
  32:11     error    empty value in block mapping  (empty-values)
  36:89     error    line too long (92 > 88 characters)  (line-length)
  37:26     warning  truthy value should be one of [false, true]  (truthy)
  58:4      warning  missing starting space in comment  (comments)
  59:4      warning  missing starting space in comment  (comments)
  61:4      warning  missing starting space in comment  (comments)
  62:4      warning  missing starting space in comment  (comments)
  63:21     warning  truthy value should be one of [false, true]  (truthy)
  64:1      error    trailing spaces  (trailing-spaces)
  65:89     error    line too long (93 > 88 characters)  (line-length)
  66:4      warning  missing starting space in comment  (comments)
  76:3      warning  comment not indented like content  (comments-indentation)
  77:6      warning  missing starting space in comment  (comments)
  78:6      warning  missing starting space in comment  (comments)
  79:23     warning  truthy value should be one of [false, true]  (truthy)
  87:20     warning  truthy value should be one of [false, true]  (truthy)
  88:20     warning  truthy value should be one of [false, true]  (truthy)
  92:12     warning  truthy value should be one of [false, true]  (truthy)
  111:8     warning  missing starting space in comment  (comments)
  119:4     error    syntax error: expected <block end>, but found '<block mapping start>'
  120:8     warning  missing starting space in comment  (comments)
  121:7     error    wrong indentation: expected 5 but found 6  (indentation)
  132:8     warning  missing starting space in comment  (comments)
  145:2     warning  missing starting space in comment  (comments)
  147:5     warning  comment not indented like content  (comments-indentation)
  148:6     warning  missing starting space in comment  (comments)
  149:6     warning  missing starting space in comment  (comments)
  150:6     warning  missing starting space in comment  (comments)
  154:6     warning  missing starting space in comment  (comments)
  155:6     warning  missing starting space in comment  (comments)
  157:2     warning  missing starting space in comment  (comments)
  159:6     warning  comment not indented like content  (comments-indentation)
  169:6     warning  comment not indented like content  (comments-indentation)
  174:1     error    too many blank lines (1 > 0)  (empty-lines)

./docker/defaults.yaml
  3:1       warning  missing document start "---"  (document-start)
  5:22      warning  truthy value should be one of [false, true]  (truthy)
  7:17      warning  truthy value should be one of [false, true]  (truthy)
  14:22     warning  truthy value should be one of [false, true]  (truthy)
  15:17     warning  truthy value should be one of [false, true]  (truthy)
  16:10     warning  truthy value should be one of [false, true]  (truthy)
  27:20     warning  truthy value should be one of [false, true]  (truthy)
  28:11     warning  truthy value should be one of [false, true]  (truthy)
  29:23     warning  truthy value should be one of [false, true]  (truthy)
  29:35     warning  missing starting space in comment  (comments)
  32:23     warning  truthy value should be one of [false, true]  (truthy)
  33:14     warning  truthy value should be one of [false, true]  (truthy)
  39:20     warning  truthy value should be one of [false, true]  (truthy)
  40:20     warning  truthy value should be one of [false, true]  (truthy)
  46:1      error    too many blank lines (1 > 0)  (empty-lines)

./docker/osfamilymap.yaml
  13:2      error    syntax error: found character '%' that cannot start any token
  50:89     error    line too long (164 > 88 characters)  (line-length)

./docker/codenamemap.yaml
  3:1       warning  missing document start "---"  (document-start)
  36:1      error    too many blank lines (1 > 0)  (empty-lines)

./docker/osmap.yaml
  1:1       error    too many blank lines (1 > 0)  (empty-lines)
  2:1       warning  missing document start "---"  (document-start)

(saltstack) imran@E6530:~/Salt/formulas/docker-formula$ yamllint -s .
./docker/osfamilymap.yaml
  13:2      error    syntax error: found character '%' that cannot start any token
  51:89     error    line too long (164 > 88 characters)  (line-length)
```

* fix(compose-ng.sls): fix `salt-lint` errors

```bash
Examining docker/compose-ng.sls of type state
[206] Jinja variables should have spaces before and after: {{ var_name }}
docker/compose-ng.sls:13
{{id}}:

[206] Jinja variables should have spaces before and after: {{ var_name }}
docker/compose-ng.sls:17
{{id}} image:

[206] Jinja variables should have spaces before and after: {{ var_name }}
docker/compose-ng.sls:22
    - name: {{image[0]}}

[206] Jinja variables should have spaces before and after: {{ var_name }}
docker/compose-ng.sls:23
    - tag: {{image[1]}}

[206] Jinja variables should have spaces before and after: {{ var_name }}
docker/compose-ng.sls:25
    - name: {{container.image}}

[206] Jinja variables should have spaces before and after: {{ var_name }}
docker/compose-ng.sls:28
{{id}} container:

[206] Jinja variables should have spaces before and after: {{ var_name }}
docker/compose-ng.sls:40
    - name: {{id}}

[206] Jinja variables should have spaces before and after: {{ var_name }}
docker/compose-ng.sls:41
    - image: {{container.image}}

[206] Jinja variables should have spaces before and after: {{ var_name }}
docker/compose-ng.sls:43
    - command: {{container.command}}

[206] Jinja variables should have spaces before and after: {{ var_name }}
docker/compose-ng.sls:48
        - {{variable}}: {{value}}

[206] Jinja variables should have spaces before and after: {{ var_name }}
docker/compose-ng.sls:57
      - "{{mapping[0]}}"

[206] Jinja variables should have spaces before and after: {{ var_name }}
docker/compose-ng.sls:59
      - "{{mapping[-1]}}/tcp":

[206] Jinja variables should have spaces before and after: {{ var_name }}
docker/compose-ng.sls:60
            HostPort: "{{mapping[-2]}}"

[206] Jinja variables should have spaces before and after: {{ var_name }}
docker/compose-ng.sls:61
            HostIp: "{{mapping[-3]|d('')}}"

[206] Jinja variables should have spaces before and after: {{ var_name }}
docker/compose-ng.sls:64
      - {{port_mapping}}

[206] Jinja variables should have spaces before and after: {{ var_name }}
docker/compose-ng.sls:71
      - {{volume}}

[206] Jinja variables should have spaces before and after: {{ var_name }}
docker/compose-ng.sls:78
      - {{volume}}

[206] Jinja variables should have spaces before and after: {{ var_name }}
docker/compose-ng.sls:86
        {{name}}: {{alias}}

[206] Jinja variables should have spaces before and after: {{ var_name }}
docker/compose-ng.sls:92
        Name: {{policy[0]}}

[206] Jinja variables should have spaces before and after: {{ var_name }}
docker/compose-ng.sls:94
        MaximumRetryCount: {{policy[1]}}

[206] Jinja variables should have spaces before and after: {{ var_name }}
docker/compose-ng.sls:99
      - docker_image: {{id}}

[206] Jinja variables should have spaces before and after: {{ var_name }}
docker/compose-ng.sls:101
      - docker: {{id}} image

[206] Jinja variables should have spaces before and after: {{ var_name }}
docker/compose-ng.sls:106
      - docker_image: {{containerid}}

[206] Jinja variables should have spaces before and after: {{ var_name }}
docker/compose-ng.sls:108
      - docker: {{containerid}}
```

* test(testinfra): remove from the formula

* test(inspec): add tests for package, config & service

* fix(pillar.example): ensure `docker.config` is available

* docs(readme): move to `docs/` directory and modify accordingly

* ci(travis): update `salt-lint` config for `v0.0.10`

* Automated using myii/ssf-formula#82

* chore(release): 0.42.0 [skip ci]

# [0.42.0](saltstack-formulas/docker-formula@v0.41.0...v0.42.0) (2019-10-23)

### Bug Fixes

* **compose-ng.sls:** fix `salt-lint` errors ([](saltstack-formulas@9e8e1e8))
* **pillar.example:** ensure `docker.config` is available ([](saltstack-formulas@dce112a))

### Continuous Integration

* **travis:** update `salt-lint` config for `v0.0.10` ([](saltstack-formulas@3eaed1b))

### Documentation

* **readme:** move to `docs/` directory and modify accordingly ([](saltstack-formulas@222fc6d))

### Features

* **semantic-release:** implement for this formula ([](saltstack-formulas@ea6be11))

### Tests

* **inspec:** add tests for package, config & service ([](saltstack-formulas@451d76d))
* **testinfra:** remove from the formula ([](saltstack-formulas@62122d2))

* ci(kitchen): use `debian-10-master-py3` instead of `develop` [skip ci]

* Automated using myii/ssf-formula#84

* ci(kitchen+travis): upgrade matrix after `2019.2.2` release [skip ci]

* Automated using myii/ssf-formula#86

* fix(release.config.js): use full commit hash in commit link [skip ci]

* Automated using myii/ssf-formula#89

* perf(travis): improve `salt-lint` invocation [skip ci]

* Automated using myii/ssf-formula#90

* ci(kitchen): use `develop` image until `master` is ready (`amazonlinux`) [skip ci]

* Automated using myii/ssf-formula#93

* ci(travis): use build config validation (beta) [skip ci]

* Automated using myii/ssf-formula#97

* ci(travis): apply changes from build config validation [skip ci]

* Automated using myii/ssf-formula#98

* ci(travis): opt-in to `dpl v2` to complete build config validation [skip ci]

* Automated using myii/ssf-formula#100

* ci(travis): run `shellcheck` during lint job [skip ci]

* Automated using myii/ssf-formula#106

* ci(travis): quote pathspecs used with `git ls-files` [skip ci]

* Automated using myii/ssf-formula#107

* ci(gemfile): restrict `train` gem version until upstream fix [skip ci]

* Automated using myii/ssf-formula#110

* ci(travis): use `major.minor` for `semantic-release` version [skip ci]

* Automated using myii/ssf-formula#112

* feat: support optional container removal before start in upstart/systemd

* chore(release): 0.43.0 [skip ci]

# [0.43.0](saltstack-formulas/docker-formula@v0.42.0...v0.43.0) (2020-01-22)

### Bug Fixes

* **release.config.js:** use full commit hash in commit link [skip ci] ([01ece3d](saltstack-formulas@01ece3d))

### Continuous Integration

* **gemfile:** restrict `train` gem version until upstream fix [skip ci] ([734d4e3](saltstack-formulas@734d4e3))
* **kitchen:** use `debian-10-master-py3` instead of `develop` [skip ci] ([d87e787](saltstack-formulas@d87e787))
* **kitchen:** use `develop` image until `master` is ready (`amazonlinux`) [skip ci] ([71c5bcb](saltstack-formulas@71c5bcb))
* **kitchen+travis:** upgrade matrix after `2019.2.2` release [skip ci] ([2189efb](saltstack-formulas@2189efb))
* **travis:** apply changes from build config validation [skip ci] ([f0a07fc](saltstack-formulas@f0a07fc))
* **travis:** opt-in to `dpl v2` to complete build config validation [skip ci] ([340556e](saltstack-formulas@340556e))
* **travis:** quote pathspecs used with `git ls-files` [skip ci] ([12bf914](saltstack-formulas@12bf914))
* **travis:** run `shellcheck` during lint job [skip ci] ([ba127a0](saltstack-formulas@ba127a0))
* **travis:** use `major.minor` for `semantic-release` version [skip ci] ([2590d61](saltstack-formulas@2590d61))
* **travis:** use build config validation (beta) [skip ci] ([fe184e9](saltstack-formulas@fe184e9))

### Features

* support optional container removal before start in upstart/systemd ([cc10d97](saltstack-formulas@cc10d97))

### Performance Improvements

* **travis:** improve `salt-lint` invocation [skip ci] ([18fa798](saltstack-formulas@18fa798))

* fix: avoid setting multiple pre-start stanzas in upstart

* ci(kitchen): avoid using bootstrap for `master` instances [skip ci]

* Automated using myii/ssf-formula#124

* chore(rubocop): move `LineLength` cop from `Metrics` to `Layout` [skip ci]

* Automated using myii/ssf-formula#129

* chore(gitignore): update from the `template-formula` [skip ci]

* Automated using myii/ssf-formula#132

Co-authored-by: Tyler Hunt <tyler.s.hunt05@gmail.com>
Co-authored-by: N <noel.mcloughlin@gmail.com>
Co-authored-by: N <noelmcloughlin@users.noreply.github.com>
Co-authored-by: Imran Iqbal <myii@users.noreply.github.com>
Co-authored-by: RemiChristiaan <remi-christiaan.cool@vbhi.com>
Co-authored-by: Yoan Blanc <yoan@dosimple.ch>
Co-authored-by: Imran Iqbal <iqbalmy@hotmail.com>
Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
Co-authored-by: Chad Bean <chad.bean@solarwinds.com>
  • Loading branch information
10 people authored Apr 3, 2020
1 parent 304d798 commit 6a49d78
Show file tree
Hide file tree
Showing 53 changed files with 1,730 additions and 504 deletions.
114 changes: 109 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
.kitchen/
.ruby-version
junit*.xml

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a packager
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
Expand All @@ -15,5 +43,81 @@ htmlcov/
.cache
nosetests.xml
coverage.xml
*,cover
*.cover
.hypothesis/
.kitchen
.kitchen.local.yml
kitchen.local.yml
junit-*.xml

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

# virtualenv
.venv
venv/
ENV/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# Bundler
.bundle/
Gemfile.lock

# copied `.md` files used for conversion to `.rst` using `m2r`
docs/*.md

# Vim
*.sw?

## Collected when centralising formulas (check and sort)
# `collectd-formula`
.pytest_cache/
/.idea/
Dockerfile.*_*
ignore/
tmp/
78 changes: 0 additions & 78 deletions .kitchen.yml

This file was deleted.

10 changes: 10 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
# General overrides used across formulas in the org
Layout/LineLength:
# Increase from default of `80`
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
Max: 88

# Any offenses that should be fixed, e.g. collected via. `rubocop --auto-gen-config`
17 changes: 17 additions & 0 deletions .salt-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
exclude_paths: []
rules:
204: # Lines should be no longer that 160 chars
ignore: |
docker/repo.sls
skip_list:
# Using `salt-lint` for linting other files as well, such as Jinja macros/templates
- 205 # Use ".sls" as a Salt State file extension
# Skipping `207` and `208` because `210` is sufficient, at least for the time-being
# I.e. Allows 3-digit unquoted codes to still be used, such as `644` and `755`
- 207 # File modes should always be encapsulated in quotation marks
- 208 # File modes should always contain a leading zero
tags: []
verbosity: 1
122 changes: 108 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,116 @@
sudo: required
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
## Machine config
os: 'linux'
arch: 'amd64'
dist: 'bionic'
version: '~> 1.0'

## Language and cache config
language: 'ruby'
cache: 'bundler'

language: python

## Services config
services:
- docker

before_install:
- bundle install
## Script to run for the test stage
script:
- bin/kitchen verify "${INSTANCE}"

## Stages and jobs matrix
stages:
- test
- name: 'release'
if: 'branch = master AND type != pull_request'
jobs:
include:
## Define the test stage that runs the linters (and testing matrix, if applicable)

env:
matrix:
- INSTANCE: default-ubuntu-1804
- INSTANCE: default-debian-jessie
- INSTANCE: default-debian-stretch
- INSTANCE: version-1131-debian-jessie
- INSTANCE: version-1131-debian-stretch
# Run all of the linters in a single job
- language: 'node_js'
node_js: 'lts/*'
env: 'Lint'
name: 'Lint: salt-lint, yamllint, rubocop, shellcheck & commitlint'
before_install: 'skip'
script:
# Install and run `salt-lint`
- pip install --user salt-lint
- git ls-files -- '*.sls' '*.jinja' '*.j2' '*.tmpl' '*.tst'
| xargs salt-lint
# Install and run `yamllint`
# Need at least `v1.17.0` for the `yaml-files` setting
- pip install --user yamllint>=1.17.0
- yamllint -s .
# Install and run `rubocop`
- gem install rubocop
- rubocop -d
# Run `shellcheck` (already pre-installed in Travis)
- shellcheck --version
- git ls-files -- '*.sh' '*.bash' '*.ksh'
| xargs shellcheck
# Install and run `commitlint`
- npm i -D @commitlint/config-conventional
@commitlint/travis-cli
- commitlint-travis

script:
- bundle exec kitchen verify ${INSTANCE}
## Define the rest of the matrix based on Kitchen testing
# Make sure the instances listed below match up with
# the `platforms` defined in `kitchen.yml`
- env: INSTANCE=default-debian-10-master-py3
# - env: INSTANCE=default-ubuntu-1804-master-py3
# - env: INSTANCE=default-centos-8-master-py3
# - env: INSTANCE=default-fedora-31-master-py3
# - env: INSTANCE=default-opensuse-leap-151-master-py3
# - env: INSTANCE=default-amazonlinux-2-master-py3
# - env: INSTANCE=default-arch-base-latest-master-py2
# - env: INSTANCE=default-debian-10-2019-2-py3
- env: INSTANCE=default-debian-9-2019-2-py3
- env: INSTANCE=default-ubuntu-1804-2019-2-py3
# - env: INSTANCE=default-centos-8-2019-2-py3
# - env: INSTANCE=default-fedora-31-2019-2-py3
# - env: INSTANCE=default-opensuse-leap-151-2019-2-py3
# - env: INSTANCE=default-centos-7-2019-2-py2
# - env: INSTANCE=default-amazonlinux-2-2019-2-py3
- env: INSTANCE=default-arch-base-latest-2019-2-py2
# - env: INSTANCE=default-fedora-30-2018-3-py3
- env: INSTANCE=default-debian-9-2018-3-py2
# - env: INSTANCE=default-ubuntu-1604-2018-3-py2
# - env: INSTANCE=default-centos-7-2018-3-py2
# - env: INSTANCE=default-opensuse-leap-151-2018-3-py2
# - env: INSTANCE=default-amazonlinux-1-2018-3-py2
# - env: INSTANCE=default-arch-base-latest-2018-3-py2
# - env: INSTANCE=default-debian-8-2017-7-py2
- env: INSTANCE=default-ubuntu-1604-2017-7-py2
# - env: INSTANCE=default-centos-6-2017-7-py2
# - env: INSTANCE=default-fedora-30-2017-7-py2
# - env: INSTANCE=default-opensuse-leap-151-2017-7-py2
# - env: INSTANCE=default-amazonlinux-1-2017-7-py2
# - env: INSTANCE=default-arch-base-latest-2017-7-py2

## Define the release stage that runs `semantic-release`
- stage: 'release'
language: 'node_js'
node_js: 'lts/*'
env: 'Release'
name: 'Run semantic-release inc. file updates to AUTHORS, CHANGELOG & FORMULA'
before_install: 'skip'
script:
# Update `AUTHORS.md`
- export MAINTAINER_TOKEN=${GH_TOKEN}
- go get github.com/myii/maintainer
- maintainer contributor

# Install all dependencies required for `semantic-release`
- npm i -D @semantic-release/changelog@3
@semantic-release/exec@3
@semantic-release/git@7
deploy:
provider: 'script'
# Opt-in to `dpl v2` to complete the Travis build config validation (beta)
# * https://docs.travis-ci.com/user/build-config-validation
# Deprecated `skip_cleanup` can now be avoided, `cleanup: false` is by default
edge: true
# Run `semantic-release`
script: 'npx semantic-release@15.14'
Loading

0 comments on commit 6a49d78

Please sign in to comment.