From da6c85c5b1b5d7f06aa8e8ee05cdbdc53ca7eadb Mon Sep 17 00:00:00 2001 From: Aaron Guise Date: Mon, 14 Mar 2022 14:58:20 +1300 Subject: [PATCH] JSONNET updated --- .drone.jsonnet | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index f4ccd85..5ece680 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -1,21 +1,19 @@ -local distros = ['centos7', +// Distros to Test on ;) +local distros = ['centos7', + 'centos8', 'debian10', 'debian11']; + +/* Configuration of DIND */ local docker_service() = { name: 'docker', image: 'docker:dind', privileged: true, - volumes: { name: 'dockersock', path: '/var/run' }, + volumes: [{ name: 'dockersock', path: '/var/run' },], }; - local pipeline(distribution) = { - kind: "pipeline", - type: "docker", - name: "%(distribution)" % { distribution: distribution } -}; - local email_notification() = { name: 'notify by email', @@ -35,7 +33,7 @@ local email_notification() = local test_distro(distribution) = { name: 'Test on %(distribution)s' % { distribution: distribution }, - volumes: { name: 'dockersock', path: '/var/run' }, + volumes: [{ name: 'dockersock', path: '/var/run' },], image: 'guisea/ansible-molecule:latest', commands: [ 'sleep 10', // give docker enough time to start @@ -49,29 +47,25 @@ local test_distro(distribution) = }, }; -local gen_pipeline() = - [{kind: 'pipeline', +local gen_pipeline(distro) = + {kind: 'pipeline', type: 'docker', name: 'Test on %(distro)s' % { distro: distro }, steps: [ - [test_distro('centos7'), + test_distro(distro), email_notification()], - [test_distro('debian10'), - email_notification()], - [test_distro('debian11'), - email_notification()], - ], services: [ docker_service(), ], volumes: - { + [{ name: 'dockersock', temp: {}, - }, - } - for distro in distros]; + },], + }; +// Generate the output [ - gen_pipeline(), -] + gen_pipeline(distro) + for distro in distros +] \ No newline at end of file