From 27e97ea40a7a21f7543e805610a349c5716fa209 Mon Sep 17 00:00:00 2001 From: Aaron Guise Date: Mon, 14 Mar 2022 14:18:48 +1300 Subject: [PATCH] Update JSONNET --- .drone.jsonnet | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index f9e6fdf..f4ccd85 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -1,3 +1,7 @@ +local distros = ['centos7', + 'debian10', + 'debian11']; + local docker_service() = { name: 'docker', @@ -6,6 +10,12 @@ local docker_service() = volumes: { name: 'dockersock', path: '/var/run' }, }; + local pipeline(distribution) = { + kind: "pipeline", + type: "docker", + name: "%(distribution)" % { distribution: distribution } +}; + local email_notification() = { name: 'notify by email', @@ -39,17 +49,29 @@ local test_distro(distribution) = }, }; -// Run the steps -{ - steps: [ +local gen_pipeline() = + [{kind: 'pipeline', + type: 'docker', + name: 'Test on %(distro)s' % { distro: distro }, + steps: [ [test_distro('centos7'), email_notification()], [test_distro('debian10'), email_notification()], [test_distro('debian11'), email_notification()], - ], - services: [ - docker_service(), - ] -} \ No newline at end of file + ], + services: [ + docker_service(), + ], + volumes: + { + name: 'dockersock', + temp: {}, + }, + } + for distro in distros]; + +[ + gen_pipeline(), +]