Skip to content

Commit 13b8215

Browse files
authored
Merge pull request #1348 from s0undt3ch/stable
[Stable] Merge forward from develop
2 parents fb7115f + 02effe0 commit 13b8215

File tree

13 files changed

+1365
-178
lines changed

13 files changed

+1365
-178
lines changed

.drone.jsonnet

Lines changed: 104 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,50 @@
1+
local git_suites = [
2+
{ name: 'Py2 2017.7(Git)', slug: 'py2-git-2017-7', depends: [] },
3+
{ name: 'Py2 2018.3(Git)', slug: 'py2-git-2018-3', depends: ['Py2 2017.7(Git)'] },
4+
{ name: 'Py2 2019.2(Git)', slug: 'py2-git-2019-2', depends: ['Py2 2018.3(Git)'] },
5+
// {name: 'Py2 develop(Stable)', slug: 'py2-git-develop'}, // Don't test against Salt's develop branch. Stability is not assured.
6+
];
7+
8+
local stable_suites = [
9+
{ name: 'Py2 2017.7(Stable)', slug: 'py2-stable-2017-7', depends: ['Py2 2017.7(Git)'] },
10+
{ name: 'Py2 2018.3(Stable)', slug: 'py2-stable-2018-3', depends: ['Py2 2018.3(Git)'] },
11+
{ name: 'Py2 2019.2(Stable)', slug: 'py2-stable-2019-2', depends: ['Py2 2019.2(Git)'] },
12+
];
13+
114
local distros = [
2-
{ name: 'amazon', version: '1' },
3-
{ name: 'amazon', version: '2' },
4-
// { name: 'centos', version: '6' },
5-
{ name: 'centos', version: '7' },
6-
{ name: 'debian', version: '8' },
7-
{ name: 'debian', version: '9' },
8-
// { name: 'ubuntu', version: '1404' },
9-
// { name: 'ubuntu', version: '1604' },
10-
{ name: 'ubuntu', version: '1804' },
15+
{ name: 'Arch', slug: 'arch', multiplier: 0, depends: [] },
16+
// { name: 'Amazon 1', slug: 'amazon-1', multiplier: 1, depends: [] },
17+
// { name: 'Amazon 2', slug: 'amazon-2', multiplier: 2, depends: [] },
18+
{ name: 'CentOS 6', slug: 'centos-6', multiplier: 3, depends: [] },
19+
{ name: 'CentOS 7', slug: 'centos-7', multiplier: 4, depends: [] },
20+
{ name: 'Debian 8', slug: 'debian-8', multiplier: 5, depends: [] },
21+
{ name: 'Debian 9', slug: 'debian-9', multiplier: 6, depends: [] },
22+
{ name: 'Fedora 28', slug: 'fedora-28', multiplier: 6, depends: [] },
23+
{ name: 'Fedora 29', slug: 'fedora-29', multiplier: 5, depends: [] },
24+
{ name: 'Opensuse 15.0', slug: 'opensuse-15', multiplier: 4, depends: [] },
25+
{ name: 'Opensuse 42.3', slug: 'opensuse-42', multiplier: 3, depends: [] },
26+
{ name: 'Ubuntu 16.04', slug: 'ubuntu-1604', multiplier: 1, depends: [] },
27+
{ name: 'Ubuntu 18.04', slug: 'ubuntu-1804', multiplier: 0, depends: [] },
28+
];
29+
30+
local stable_distros = [
31+
'amazon-1',
32+
'amazon-2',
33+
'centos-6',
34+
'centos-7',
35+
'debian-8',
36+
'debian-9',
37+
'ubuntu-1604',
38+
'ubuntu-1804',
1139
];
1240

1341
local Shellcheck() = {
1442
kind: 'pipeline',
15-
name: 'run-shellcheck',
43+
name: 'Lint',
1644

1745
steps: [
1846
{
19-
name: 'build',
47+
name: 'shellcheck',
2048
image: 'koalaman/shellcheck-alpine',
2149
commands: [
2250
'shellcheck -s sh -f checkstyle bootstrap-salt.sh',
@@ -25,30 +53,84 @@ local Shellcheck() = {
2553
],
2654
};
2755

28-
local Build(os, os_version) = {
56+
57+
local Build(distro) = {
2958
kind: 'pipeline',
30-
name: std.format('build-%s-%s', [os, os_version]),
59+
name: distro.name,
60+
node: {
61+
project: 'open',
62+
},
63+
64+
local suites = if std.count(stable_distros, distro.slug) > 0 then git_suites + stable_suites else git_suites,
3165

3266
steps: [
3367
{
34-
name: 'build',
35-
privileged: true,
36-
image: 'saltstack/drone-plugin-kitchen',
37-
settings: {
38-
target: std.format('%s-%s', [os, os_version]),
39-
requirements: 'tests/requirements.txt',
68+
name: 'throttle-build',
69+
image: 'alpine',
70+
commands: [
71+
std.format(
72+
"sh -c 't=%(offset)s; echo Sleeping %(offset)s seconds; sleep %(offset)s'",
73+
{ offset: 5 * std.length(suites) * distro.multiplier }
74+
),
75+
],
76+
},
77+
{
78+
name: 'create',
79+
image: 'saltstack/drone-salt-bootstrap-testing',
80+
environment: {
81+
DOCKER_HOST: 'tcp://docker:2375',
4082
},
83+
depends_on: [
84+
'throttle-build',
85+
],
86+
commands: [
87+
'bundle install --with docker --without opennebula ec2 windows vagrant',
88+
"echo 'Waiting for docker to start'",
89+
'sleep 10', // give docker enough time to start
90+
'docker ps -a',
91+
std.format('bundle exec kitchen create %s', [distro.slug]),
92+
],
4193
},
94+
] + [
95+
{
96+
name: suite.name,
97+
image: 'saltstack/drone-salt-bootstrap-testing',
98+
environment: {
99+
DOCKER_HOST: 'tcp://docker:2375',
100+
},
101+
depends_on: [
102+
'throttle-build',
103+
'create',
104+
],
105+
commands: [
106+
'pip install -U pip',
107+
'pip install -r tests/requirements.txt',
108+
'bundle install --with docker --without opennebula ec2 windows vagrant',
109+
std.format('bundle exec kitchen test %s-%s', [suite.slug, distro.slug]),
110+
],
111+
}
112+
for suite in suites
42113
],
43-
depends_on: [
44-
'run-shellcheck',
114+
services: [
115+
{
116+
name: 'docker',
117+
image: 'saltstack/drone-salt-bootstrap-testing',
118+
privileged: true,
119+
environment: {},
120+
command: [
121+
'--storage-driver=overlay2',
122+
],
123+
},
45124
],
125+
depends_on: [
126+
'Lint',
127+
] + distro.depends,
46128
};
47129

48130

49131
[
50132
Shellcheck(),
51133
] + [
52-
Build(distro.name, distro.version)
134+
Build(distro)
53135
for distro in distros
54136
]

0 commit comments

Comments
 (0)