refactor distro substitution to function

This commit is contained in:
2022-03-15 07:46:37 +13:00
parent e565652503
commit 07daae1d83

View File

@@ -47,8 +47,8 @@ local test_distro(distribution) =
}, },
}; };
local gen_pipeline(distro) = local gen_pipeline() =
{kind: 'pipeline', [{kind: 'pipeline',
type: 'docker', type: 'docker',
name: 'Test on %(distro)s' % { distro: distro }, name: 'Test on %(distro)s' % { distro: distro },
steps: steps:
@@ -61,17 +61,15 @@ local gen_pipeline(distro) =
temp: {}, temp: {},
}, },
], ],
}; }
for distro in distros];
// Generate the output // Generate the output
[ [
[
gen_pipeline(distro)
for distro in distros
],
{kind: 'pipeline', {kind: 'pipeline',
name: 'Send notification by email', name: 'Send notification by email',
steps: email_notification(), steps: email_notification(),
depends_on: distros depends_on: distros
} },
gen_pipeline()
] ]