Fan out/Fan In

This commit is contained in:
2022-03-15 07:14:13 +13:00
parent fd75e6421c
commit e565652503

View File

@@ -17,7 +17,6 @@ local docker_service() =
local email_notification() = local email_notification() =
{ {
name: 'notify by email',
image: 'drillster/drone-email', image: 'drillster/drone-email',
settings: settings:
{ host: 'mail.guise.net.nz', { host: 'mail.guise.net.nz',
@@ -28,7 +27,7 @@ local email_notification() =
from: 'drone@guise.net.nz' from: 'drone@guise.net.nz'
}, },
when: when:
{ status: [ 'changed', 'failure' ] }, { status: [ 'success', 'failure' ] },
}; };
local test_distro(distribution) = local test_distro(distribution) =
@@ -52,21 +51,27 @@ local gen_pipeline(distro) =
{kind: 'pipeline', {kind: 'pipeline',
type: 'docker', type: 'docker',
name: 'Test on %(distro)s' % { distro: distro }, name: 'Test on %(distro)s' % { distro: distro },
steps: [ steps:
test_distro(distro), test_distro(distro),
email_notification()], services:
services: [
docker_service(), docker_service(),
],
volumes: volumes:
[{ [{
name: 'dockersock', name: 'dockersock',
temp: {}, temp: {},
},], },
],
}; };
// Generate the output // Generate the output
[ [
[
gen_pipeline(distro) gen_pipeline(distro)
for distro in distros for distro in distros
],
{kind: 'pipeline',
name: 'Send notification by email',
steps: email_notification(),
depends_on: distros
}
] ]