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