Skip to content

Commit

Permalink
test(travis): add travis yml
Browse files Browse the repository at this point in the history
  • Loading branch information
noelmcloughlin committed Oct 4, 2019
1 parent 55e4cfb commit 828f827
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 54 deletions.
86 changes: 86 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
dist: bionic
stages:
- test
- lint
- name: release
if: branch = master AND type != pull_request

sudo: required
cache: bundler
language: ruby

services:
- docker

# Make sure the instances listed below match up with
# the `platforms` defined in `kitchen.yml`
env:
matrix:
- INSTANCE: default-debian-10-develop-py3
# - INSTANCE: default-ubuntu-1804-develop-py3
# - INSTANCE: default-centos-7-develop-py3
# - INSTANCE: default-fedora-30-develop-py3
# - INSTANCE: default-opensuse-leap-15-develop-py3
# - INSTANCE: default-amazonlinux-2-develop-py2
# - INSTANCE: default-debian-9-2019-2-py3
- INSTANCE: default-ubuntu-1804-2019-2-py3
# - INSTANCE: default-centos-7-2019-2-py3
# - INSTANCE: default-fedora-30-2019-2-py3
# - INSTANCE: default-opensuse-leap-15-2019-2-py3
- INSTANCE: default-amazonlinux-2-2019-2-py2
# - INSTANCE: default-debian-9-2018-3-py2
# - INSTANCE: default-ubuntu-1604-2018-3-py2
# - INSTANCE: default-centos-7-2018-3-py2
- INSTANCE: default-fedora-29-2018-3-py2
- INSTANCE: default-opensuse-leap-15-2018-3-py2
# - INSTANCE: default-amazonlinux-2-2018-3-py2
# - INSTANCE: default-debian-8-2017-7-py2
# - INSTANCE: default-ubuntu-1604-2017-7-py2
- INSTANCE: default-centos-6-2017-7-py2
# - INSTANCE: default-fedora-29-2017-7-py2
# - INSTANCE: default-opensuse-leap-15-2017-7-py2
# - INSTANCE: default-amazonlinux-2-2017-7-py2

script:
- bin/kitchen verify ${INSTANCE}

jobs:
include:
# Define the `lint` stage (runs `yamllint` and `commitlint`)
- stage: lint
language: node_js
node_js: lts/*
before_install: skip
script:
# 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 `commitlint`
- npm install @commitlint/config-conventional -D
- npm install @commitlint/travis-cli -D
- commitlint-travis
# Define the release stage that runs `semantic-release`
- stage: release
language: node_js
node_js: lts/*
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 install @semantic-release/changelog@3 -D
- npm install @semantic-release/exec@3 -D
- npm install @semantic-release/git@7 -D
deploy:
provider: script
skip_cleanup: true
script:
# Run `semantic-release`
- npx semantic-release@15
30 changes: 30 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
# Extend the `default` configuration provided by `yamllint`
extends: default

# Files to ignore completely
# 1. All YAML files under directory `node_modules/`, introduced during the Travis run
# 2. Any SLS files under directory `test/`, which are actually state files
ignore: |
node_modules/
test/**/states/**/*.sls
yaml-files:
# Default settings
- '*.yaml'
- '*.yml'
- .yamllint
# SaltStack Formulas additional settings
- '*.example'
- test/**/*.sls

rules:
empty-values:
forbid-in-block-mappings: true
forbid-in-flow-mappings: true
line-length:
# Increase from default of `80`
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
max: 88
46 changes: 20 additions & 26 deletions iscsi/osfamilymap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,55 +34,49 @@ Debian:
RedHat:
config:
name:
tgtd: /etc/tgt/targets.conf #cent6
tgtd: /etc/tgt/targets.conf #cent6
servicename:
open-iscsi: iscsi
isns: isnsd
tgtd: tgtd #cent6
tgtd: tgtd #cent6
isns:
pkgs:
wanted:
- isns-utils
- yum-plugin-versionlock
# target-isns #fedora29
# target-isns
initiator:
pkgs:
wanted:
- iscsi-initiator-utils #cent6/cent7/fedora/amazon
{%- if grains.osmajorrelease >= 7 %}
- iscsi-initiator-utils-iscsiuio #cent7/fedora
- libiscsi #cent7/fedora
- libiscsi-utils #cent7/fedora
- iscsi-initiator-utils
{%- if 'osmajorrrelease' in grains and grains.osmajorrelease >= 7 %}
- iscsi-initiator-utils-iscsiuio
- libiscsi
- libiscsi-utils
{%- endif %}
target:
pkgs:
wanted:
- device-mapper-persistent-data #cent6/cent7/fedora/amazon
{%- if grains.osmajorrelease == 6 %}
- scsi-target-utils #cent6/fedora
- fcoe-utils #cent6/fedora
- fcoe-target-utils #cent6

{%- elif grains.osmajorrelease >= 7 %}
- yum-plugin-versionlock #cent6/cent7/fedora
- targetcli #cent7/fedora
- libvirt-daemon-driver-storage-iscsi #cent7/fedora

{%- if grains.os not in ('Amazon',) %}
- netbsd-iscsi #cent6/cent7/fedora
- udisks2-iscsi #cent7/fedora
- device-mapper-persistent-data
{%- if 'osmajorrrelease' in grains and grains.osmajorrelease == 6 %}
- scsi-target-utils
- fcoe-utils
- fcoe-target-utils
{%- elif 'osmajorrrelease' in grains and grains.osmajorrelease >= 7 %}
- yum-plugin-versionlock
- targetcli
- libvirt-daemon-driver-storage-iscsi
{%- if 'os' in grains and grains.os not in ('Amazon',) %}
- netbsd-iscsi
- udisks2-iscsi
{%- endif %}
{%- endif %}

Suse:
config:
servicename:
open-iscsi: iscsid
{%- if grains.osmajorrelease >= 15 %}
lio: targetcli
{%- else %}
lio: target
{%- endif %}
isns:
pkgs:
wanted:
Expand Down
32 changes: 4 additions & 28 deletions kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ provisioner:
log_level: info
salt_install: none
require_chef: false
formula: template
formula: iscsi
salt_copy_filter:
- .kitchen
- .git
Expand All @@ -150,42 +150,18 @@ verifier:

suites:
- name: default
excludes:
- centos-6-2017-7-py2
provisioner:
state_top:
base:
'*':
- template
- iscsi
pillars:
top.sls:
base:
'*':
- template
- define_roles
- iscsi
pillars_from_files:
template.sls: pillar.example
define_roles.sls: test/salt/pillar/define_roles.sls
verifier:
inspec_tests:
- path: test/integration/default
- name: centos6
includes:
- centos-6-2017-7-py2
provisioner:
state_top:
base:
'*':
- template
pillars:
top.sls:
base:
'*':
- template
- define_roles
pillars_from_files:
template.sls: test/salt/pillar/centos6.sls
define_roles.sls: test/salt/pillar/define_roles.sls
iscsi.sls: pillar.example
verifier:
inspec_tests:
- path: test/integration/default

0 comments on commit 828f827

Please sign in to comment.