Browse Source

Merge pull request #182 from baby-gnu/feature/update-ci-to-latest-standards

feat(ci): update ci to latest standards
tags/v1.2.0
Imran Iqbal 4 years ago
parent
commit
06f5f7ef2a
No account linked to committer's email address
5 changed files with 98 additions and 109 deletions
  1. +29
    -38
      .travis.yml
  2. +64
    -67
      kitchen.yml
  3. +2
    -2
      openssh/config.sls
  4. +1
    -1
      openssh/known_hosts.sls
  5. +2
    -1
      test/integration/default/controls/packages_spec.rb

+ 29
- 38
.travis.yml View File

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


# Run all of the linters in a single job (except `rubocop`)
# Run all of the linters in a single job
- language: 'node_js' - language: 'node_js'
node_js: 'lts/*' node_js: 'lts/*'
env: 'Lint' env: 'Lint'
name: 'Lint: salt-lint, yamllint, shellcheck & commitlint'
name: 'Lint: salt-lint, yamllint, rubocop, shellcheck & commitlint'
before_install: 'skip' before_install: 'skip'
script: script:
# Install and run `salt-lint` # Install and run `salt-lint`
# Need at least `v1.17.0` for the `yaml-files` setting # Need at least `v1.17.0` for the `yaml-files` setting
- pip install --user yamllint>=1.17.0 - pip install --user yamllint>=1.17.0
- yamllint -s . - yamllint -s .
# Install and run `rubocop`
- gem install rubocop
- rubocop -d
# Run `shellcheck` (already pre-installed in Travis) # Run `shellcheck` (already pre-installed in Travis)
- shellcheck --version - shellcheck --version
- git ls-files -- '*.sh' '*.bash' '*.ksh' - git ls-files -- '*.sh' '*.bash' '*.ksh'
- npm i -D @commitlint/config-conventional - npm i -D @commitlint/config-conventional
@commitlint/travis-cli @commitlint/travis-cli
- commitlint-travis - commitlint-travis
# Run the `rubocop` linter in a separate job that is allowed to fail
# Once these lint errors are fixed, this can be merged into a single job
- language: node_js
node_js: lts/*
env: Lint_rubocop
name: 'Lint: rubocop'
before_install: skip
script:
# Install and run `rubocop`
- gem install rubocop
- rubocop -d


## Define the rest of the matrix based on Kitchen testing ## Define the rest of the matrix based on Kitchen testing
# Make sure the instances listed below match up with # Make sure the instances listed below match up with
# the `platforms` defined in `kitchen.yml` # the `platforms` defined in `kitchen.yml`
- env: INSTANCE=default-debian-10-master-py3 - env: INSTANCE=default-debian-10-master-py3
- env: INSTANCE=default-ubuntu-2004-master-py3
# - env: INSTANCE=default-ubuntu-1804-master-py3 # - env: INSTANCE=default-ubuntu-1804-master-py3
# - env: INSTANCE=default-centos-8-master-py3
- env: INSTANCE=default-centos-8-master-py3
- env: INSTANCE=default-fedora-32-master-py3
# - env: INSTANCE=default-fedora-31-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-opensuse-leap-152-master-py3
- env: INSTANCE=default-amazonlinux-2-master-py3
# - env: INSTANCE=default-debian-10-3000-3-py3
# - env: INSTANCE=default-debian-9-3000-3-py3
# - env: INSTANCE=default-ubuntu-1804-3000-3-py3
# - env: INSTANCE=default-centos-8-3000-3-py3
# - env: INSTANCE=default-centos-7-3000-3-py3
# - env: INSTANCE=default-fedora-31-3000-3-py3
# - env: INSTANCE=default-opensuse-leap-152-3000-3-py3
# - env: INSTANCE=default-amazonlinux-2-3000-3-py3
# - env: INSTANCE=default-ubuntu-1804-3000-3-py2
# - env: INSTANCE=default-ubuntu-1604-3000-3-py2
# - env: INSTANCE=default-arch-base-latest-3000-3-py2
# - env: INSTANCE=default-debian-10-2019-2-py3 # - env: INSTANCE=default-debian-10-2019-2-py3
# - env: INSTANCE=default-debian-9-2019-2-py3 # - env: INSTANCE=default-debian-9-2019-2-py3
- env: INSTANCE=default-ubuntu-1804-2019-2-py3
# - env: INSTANCE=default-ubuntu-1804-2019-2-py3
# - env: INSTANCE=default-ubuntu-1604-2019-2-py3
# - env: INSTANCE=default-centos-8-2019-2-py3 # - env: INSTANCE=default-centos-8-2019-2-py3
# - env: INSTANCE=default-centos-7-2019-2-py3
# - env: INSTANCE=default-fedora-31-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
# - env: INSTANCE=default-opensuse-leap-152-2019-2-py3
# - env: INSTANCE=default-amazonlinux-2-2019-2-py3
# - env: INSTANCE=default-centos-6-2019-2-py2
# - env: INSTANCE=default-amazonlinux-1-2019-2-py2
- env: INSTANCE=default-arch-base-latest-2019-2-py2


## Define the release stage that runs `semantic-release` ## Define the release stage that runs `semantic-release`
- stage: 'release' - stage: 'release'

+ 64
- 67
kitchen.yml View File

- name: debian-10-master-py3 - name: debian-10-master-py3
driver: driver:
image: saltimages/salt-master-py3:debian-10 image: saltimages/salt-master-py3:debian-10
- name: ubuntu-2004-master-py3
driver:
image: saltimages/salt-master-py3:ubuntu-20.04
- name: ubuntu-1804-master-py3 - name: ubuntu-1804-master-py3
driver: driver:
image: saltimages/salt-master-py3:ubuntu-18.04 image: saltimages/salt-master-py3:ubuntu-18.04
- name: centos-8-master-py3 - name: centos-8-master-py3
driver: driver:
image: saltimages/salt-master-py3:centos-8 image: saltimages/salt-master-py3:centos-8
- name: fedora-32-master-py3
driver:
image: saltimages/salt-master-py3:fedora-32
- name: fedora-31-master-py3 - name: fedora-31-master-py3
driver: driver:
image: saltimages/salt-master-py3:fedora-31 image: saltimages/salt-master-py3:fedora-31
- name: opensuse-leap-151-master-py3
- name: opensuse-leap-152-master-py3
driver: driver:
image: netmanagers/salt-master-py3:opensuse-leap-15.1
image: saltimages/salt-master-py3:opensuse-leap-15.2
run_command: /usr/lib/systemd/systemd run_command: /usr/lib/systemd/systemd
# Workaround to avoid intermittent failures on `opensuse-leap-15.1`:
# Workaround to avoid intermittent failures on `opensuse-leap-15.2`:
# => SCP did not finish successfully (255): (Net::SCP::Error) # => SCP did not finish successfully (255): (Net::SCP::Error)
transport: transport:
max_ssh_sessions: 1 max_ssh_sessions: 1
driver: driver:
image: saltimages/salt-master-py3:amazonlinux-2 image: saltimages/salt-master-py3:amazonlinux-2


## SALT `2019.2`
- name: debian-10-2019-2-py3
## SALT `3000.3`
- name: debian-10-3000-3-py3
driver: driver:
image: saltimages/salt-2019.2-py3:debian-10
- name: debian-9-2019-2-py3
image: saltimages/salt-3000.3-py3:debian-10
- name: debian-9-3000-3-py3
driver: driver:
image: saltimages/salt-2019.2-py3:debian-9
- name: ubuntu-1804-2019-2-py3
image: saltimages/salt-3000.3-py3:debian-9
- name: ubuntu-1804-3000-3-py3
driver: driver:
image: saltimages/salt-2019.2-py3:ubuntu-18.04
- name: centos-8-2019-2-py3
image: saltimages/salt-3000.3-py3:ubuntu-18.04
- name: centos-8-3000-3-py3
driver: driver:
image: saltimages/salt-2019.2-py3:centos-8
- name: fedora-31-2019-2-py3
image: saltimages/salt-3000.3-py3:centos-8
- name: centos-7-3000-3-py3
driver: driver:
image: saltimages/salt-2019.2-py3:fedora-31
- name: opensuse-leap-151-2019-2-py3
image: saltimages/salt-3000.3-py3:centos-7
- name: fedora-31-3000-3-py3
driver: driver:
image: netmanagers/salt-2019.2-py3:opensuse-leap-15.1
image: saltimages/salt-3000.3-py3:fedora-31
- name: opensuse-leap-152-3000-3-py3
driver:
image: saltimages/salt-3000.3-py3:opensuse-leap-15.2
run_command: /usr/lib/systemd/systemd run_command: /usr/lib/systemd/systemd
# Workaround to avoid intermittent failures on `opensuse-leap-15.1`:
# Workaround to avoid intermittent failures on `opensuse-leap-15.2`:
# => SCP did not finish successfully (255): (Net::SCP::Error) # => SCP did not finish successfully (255): (Net::SCP::Error)
transport: transport:
max_ssh_sessions: 1 max_ssh_sessions: 1
- name: centos-7-2019-2-py2
- name: amazonlinux-2-3000-3-py3
driver: driver:
image: netmanagers/salt-2019.2-py2:centos-7
- name: amazonlinux-2-2019-2-py3
image: saltimages/salt-3000.3-py3:amazonlinux-2
- name: ubuntu-1804-3000-3-py2
driver: driver:
image: saltimages/salt-2019.2-py3:amazonlinux-2
- name: arch-base-latest-2019-2-py2
image: saltimages/salt-3000.3-py2:ubuntu-18.04
- name: ubuntu-1604-3000-3-py2
driver: driver:
image: saltimages/salt-2019.2-py2:arch-base-latest
image: saltimages/salt-3000.3-py2:ubuntu-16.04
- name: arch-base-latest-3000-3-py2
driver:
image: saltimages/salt-3000.3-py2:arch-base-latest
run_command: /usr/lib/systemd/systemd run_command: /usr/lib/systemd/systemd


## SALT `2018.3`
- name: fedora-30-2018-3-py3
driver:
image: netmanagers/salt-2018.3-py3:fedora-30
- name: debian-9-2018-3-py2
driver:
image: netmanagers/salt-2018.3-py2:debian-9
- name: ubuntu-1604-2018-3-py2
driver:
image: netmanagers/salt-2018.3-py2:ubuntu-16.04
- name: centos-7-2018-3-py2
driver:
image: netmanagers/salt-2018.3-py2:centos-7
- name: opensuse-leap-151-2018-3-py2
## SALT `2019.2`
- name: debian-10-2019-2-py3
driver: driver:
image: netmanagers/salt-2018.3-py2:opensuse-leap-15.1
run_command: /usr/lib/systemd/systemd
# Workaround to avoid intermittent failures on `opensuse-leap-15.1`:
# => SCP did not finish successfully (255): (Net::SCP::Error)
transport:
max_ssh_sessions: 1
- name: amazonlinux-1-2018-3-py2
image: saltimages/salt-2019.2-py3:debian-10
- name: debian-9-2019-2-py3
driver: driver:
image: netmanagers/salt-2018.3-py2:amazonlinux-1
run_command: /sbin/init
- name: arch-base-latest-2018-3-py2
image: saltimages/salt-2019.2-py3:debian-9
- name: ubuntu-1804-2019-2-py3
driver: driver:
image: netmanagers/salt-2018.3-py2:arch-base-latest
run_command: /usr/lib/systemd/systemd

## SALT `2017.7`
- name: debian-8-2017-7-py2
image: saltimages/salt-2019.2-py3:ubuntu-18.04
- name: ubuntu-1604-2019-2-py3
driver: driver:
image: netmanagers/salt-2017.7-py2:debian-8
- name: ubuntu-1604-2017-7-py2
image: saltimages/salt-2019.2-py3:ubuntu-16.04
- name: centos-8-2019-2-py3
driver: driver:
image: netmanagers/salt-2017.7-py2:ubuntu-16.04
- name: centos-6-2017-7-py2
image: saltimages/salt-2019.2-py3:centos-8
- name: centos-7-2019-2-py3
driver: driver:
image: netmanagers/salt-2017.7-py2:centos-6
run_command: /sbin/init
- name: fedora-30-2017-7-py2
image: saltimages/salt-2019.2-py3:centos-7
- name: fedora-31-2019-2-py3
driver: driver:
image: netmanagers/salt-2017.7-py2:fedora-30
- name: opensuse-leap-151-2017-7-py2
image: saltimages/salt-2019.2-py3:fedora-31
- name: opensuse-leap-152-2019-2-py3
driver: driver:
image: netmanagers/salt-2017.7-py2:opensuse-leap-15.1
image: saltimages/salt-2019.2-py3:opensuse-leap-15.2
run_command: /usr/lib/systemd/systemd run_command: /usr/lib/systemd/systemd
# Workaround to avoid intermittent failures on `opensuse-leap-15.1`:
# Workaround to avoid intermittent failures on `opensuse-leap-15.2`:
# => SCP did not finish successfully (255): (Net::SCP::Error) # => SCP did not finish successfully (255): (Net::SCP::Error)
transport: transport:
max_ssh_sessions: 1 max_ssh_sessions: 1
- name: amazonlinux-1-2017-7-py2
- name: amazonlinux-2-2019-2-py3
driver: driver:
image: netmanagers/salt-2017.7-py2:amazonlinux-1
image: saltimages/salt-2019.2-py3:amazonlinux-2
- name: centos-6-2019-2-py2
driver:
image: saltimages/salt-2019.2-py2:centos-6
run_command: /sbin/init
- name: amazonlinux-1-2019-2-py2
driver:
image: saltimages/salt-2019.2-py2:amazonlinux-1
run_command: /sbin/init run_command: /sbin/init
- name: arch-base-latest-2017-7-py2
- name: arch-base-latest-2019-2-py2
driver: driver:
image: netmanagers/salt-2017.7-py2:arch-base-latest
image: saltimages/salt-2019.2-py2:arch-base-latest
run_command: /usr/lib/systemd/systemd run_command: /usr/lib/systemd/systemd


provisioner: provisioner:

+ 2
- 2
openssh/config.sls View File

) }} ) }}
- template: jinja - template: jinja
- context: - context:
sshd_config: {{ sshd_config }}
sshd_config: {{ sshd_config | json }}
- user: {{ openssh.sshd_config_user }} - user: {{ openssh.sshd_config_user }}
- group: {{ openssh.sshd_config_group }} - group: {{ openssh.sshd_config_group }}
- mode: {{ openssh.sshd_config_mode }} - mode: {{ openssh.sshd_config_mode }}
) }} ) }}
- template: jinja - template: jinja
- context: - context:
ssh_config: {{ ssh_config }}
ssh_config: {{ ssh_config | json }}
- user: {{ openssh.ssh_config_user }} - user: {{ openssh.ssh_config_user }}
- group: {{ openssh.ssh_config_group }} - group: {{ openssh.ssh_config_group }}
- mode: {{ openssh.ssh_config_mode }} - mode: {{ openssh.ssh_config_mode }}

+ 1
- 1
openssh/known_hosts.sls View File

) }} ) }}
- template: jinja - template: jinja
- context: - context:
known_hosts: {{ openssh | traverse("known_hosts", {}) }}
known_hosts: {{ openssh | traverse("known_hosts", {}) | json }}
- user: root - user: root
- group: {{ openssh.ssh_config_group }} - group: {{ openssh.ssh_config_group }}
- mode: 644 - mode: 644

+ 2
- 1
test/integration/default/controls/packages_spec.rb View File

# Overide by Platform # Overide by Platform
package_name = package_name =
case platform[:family] case platform[:family]
when 'suse'
# `linux` here is sufficient for `arch`
when 'suse', 'linux'
'openssh' 'openssh'
else else
'openssh-server' 'openssh-server'

Loading…
Cancel
Save