From 07daae1d838a83dbe51813cbcf79a3c8501332e6 Mon Sep 17 00:00:00 2001 From: Aaron Guise Date: Tue, 15 Mar 2022 07:46:37 +1300 Subject: [PATCH] refactor distro substitution to function --- .drone.jsonnet | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 925c6a7..c6cf535 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -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() ] \ No newline at end of file