salt-bootstrap/.drone.jsonnet

53 lines
1.2 KiB
Jsonnet
Raw Normal View History

2019-02-06 09:22:02 -07:00
local distros = [
{ name: 'amazon', version: '1' },
{ name: 'amazon', version: '2' },
# { name: 'centos', version: '6' },
{ name: 'centos', version: '7' },
{ name: 'debian', version: '8' },
{ name: 'debian', version: '9' },
# { name: 'ubuntu', version: '1404' },
# { name: 'ubuntu', version: '1604' },
{ name: 'ubuntu', version: '1804' },
];
2019-02-01 11:27:03 -07:00
local Shellcheck() = {
kind: 'pipeline',
name: 'run-shellcheck',
2019-02-01 11:35:53 -07:00
2019-02-01 11:27:03 -07:00
steps: [
{
name: 'build',
2019-02-01 11:27:03 -07:00
image: 'koalaman/shellcheck-alpine',
commands: [
'shellcheck -s sh -f checkstyle bootstrap-salt.sh',
],
when: { event: ['pull_request'] }
}
]
};
2019-02-01 10:29:57 -07:00
local Build(os, os_version) = {
kind: 'pipeline',
2019-02-06 09:22:02 -07:00
name: std.format('build-%s-%s', [os, os_version]),
2019-02-01 11:27:03 -07:00
2019-02-01 10:29:57 -07:00
steps: [
{
name: 'build',
2019-02-01 10:29:57 -07:00
privileged: true,
image: 'saltstack/drone-plugin-kitchen',
2019-02-01 10:29:57 -07:00
settings: {
2019-02-06 09:22:02 -07:00
target: std.format('%s-%s', [os, os_version]),
2019-02-01 10:29:57 -07:00
requirements: 'tests/requirements.txt',
},
2019-02-01 11:05:41 -07:00
when: { event: ['pull_request'] },
},
],
2019-02-01 10:29:57 -07:00
depends_on: [
'run-shellcheck'
2019-02-01 11:05:41 -07:00
]
2019-02-01 10:29:57 -07:00
};
2019-02-06 09:22:02 -07:00
2019-02-01 13:18:24 -07:00
[Shellcheck()] + [Build(distro.name, distro.version)for distro in distros]