From 04d4efa4bb3ff35a4d6fe608d1118c894aa45de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Thu, 15 Oct 2020 19:05:04 +0200 Subject: [PATCH 1/3] fix: delegate pushes to variants --- .ci/packaging.groovy | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index f8a64f525c6e..82605788b413 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -174,19 +174,17 @@ pipeline { def pushCIDockerImages(){ catchError(buildResult: 'UNSTABLE', message: 'Unable to push Docker images', stageResult: 'FAILURE') { if ("${env.BEATS_FOLDER}" == "auditbeat"){ - tagAndPush('auditbeat-oss') + tagAndPush('auditbeat') } else if ("${env.BEATS_FOLDER}" == "filebeat") { - tagAndPush('filebeat-oss') + tagAndPush('filebeat') } else if ("${env.BEATS_FOLDER}" == "heartbeat"){ - tagAndPush('heartbeat-oss') + tagAndPush('heartbeat') } else if ("${env.BEATS_FOLDER}" == "journalbeat"){ tagAndPush('journalbeat') - tagAndPush('journalbeat-oss') } else if ("${env.BEATS_FOLDER}" == "metricbeat"){ - tagAndPush('metricbeat-oss') + tagAndPush('metricbeat') } else if ("${env.BEATS_FOLDER}" == "packetbeat"){ tagAndPush('packetbeat') - tagAndPush('packetbeat-oss') } else if ("${env.BEATS_FOLDER}" == "x-pack/auditbeat"){ tagAndPush('auditbeat') } else if ("${env.BEATS_FOLDER}" == "x-pack/elastic-agent") { From 5bb50884d5892d268ef6b5a8231f2e5a9e13bf2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Thu, 15 Oct 2020 19:06:42 +0200 Subject: [PATCH 2/3] chore: group conditions for x-pack --- .ci/packaging.groovy | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index 82605788b413..db50dc3e1034 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -173,28 +173,20 @@ pipeline { def pushCIDockerImages(){ catchError(buildResult: 'UNSTABLE', message: 'Unable to push Docker images', stageResult: 'FAILURE') { - if ("${env.BEATS_FOLDER}" == "auditbeat"){ + if ("${env.BEATS_FOLDER}" == "auditbeat" || "${env.BEATS_FOLDER}" == "x-pack/auditbeat"){ tagAndPush('auditbeat') - } else if ("${env.BEATS_FOLDER}" == "filebeat") { + } else if ("${env.BEATS_FOLDER}" == "filebeat" || "${env.BEATS_FOLDER}" == "x-pack/filebeat") { tagAndPush('filebeat') - } else if ("${env.BEATS_FOLDER}" == "heartbeat"){ + } else if ("${env.BEATS_FOLDER}" == "heartbeat" || "${env.BEATS_FOLDER}" == "x-pack/heartbeat"){ tagAndPush('heartbeat') } else if ("${env.BEATS_FOLDER}" == "journalbeat"){ tagAndPush('journalbeat') - } else if ("${env.BEATS_FOLDER}" == "metricbeat"){ + } else if ("${env.BEATS_FOLDER}" == "metricbeat" || "${env.BEATS_FOLDER}" == "x-pack/metricbeat"){ tagAndPush('metricbeat') } else if ("${env.BEATS_FOLDER}" == "packetbeat"){ tagAndPush('packetbeat') - } else if ("${env.BEATS_FOLDER}" == "x-pack/auditbeat"){ - tagAndPush('auditbeat') } else if ("${env.BEATS_FOLDER}" == "x-pack/elastic-agent") { tagAndPush('elastic-agent') - } else if ("${env.BEATS_FOLDER}" == "x-pack/filebeat"){ - tagAndPush('filebeat') - } else if ("${env.BEATS_FOLDER}" == "x-pack/heartbeat"){ - tagAndPush('heartbeat') - } else if ("${env.BEATS_FOLDER}" == "x-pack/metricbeat"){ - tagAndPush('metricbeat') } } } From a374ed7484353299d003fc963bd1c098eff2b13b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Fri, 16 Oct 2020 11:54:02 +0200 Subject: [PATCH 3/3] chore: simplify with endsWith Co-authored-by: Victor Martinez --- .ci/packaging.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index db50dc3e1034..4145ee6bdd13 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -173,15 +173,15 @@ pipeline { def pushCIDockerImages(){ catchError(buildResult: 'UNSTABLE', message: 'Unable to push Docker images', stageResult: 'FAILURE') { - if ("${env.BEATS_FOLDER}" == "auditbeat" || "${env.BEATS_FOLDER}" == "x-pack/auditbeat"){ + if (env?.BEATS_FOLDER?.endsWith('auditbeat')) { tagAndPush('auditbeat') - } else if ("${env.BEATS_FOLDER}" == "filebeat" || "${env.BEATS_FOLDER}" == "x-pack/filebeat") { + } else if (env?.BEATS_FOLDER?.endsWith('filebeat')) { tagAndPush('filebeat') - } else if ("${env.BEATS_FOLDER}" == "heartbeat" || "${env.BEATS_FOLDER}" == "x-pack/heartbeat"){ + } else if (env?.BEATS_FOLDER?.endsWith('heartbeat')) { tagAndPush('heartbeat') } else if ("${env.BEATS_FOLDER}" == "journalbeat"){ tagAndPush('journalbeat') - } else if ("${env.BEATS_FOLDER}" == "metricbeat" || "${env.BEATS_FOLDER}" == "x-pack/metricbeat"){ + } else if (env?.BEATS_FOLDER?.endsWith('metricbeat')) { tagAndPush('metricbeat') } else if ("${env.BEATS_FOLDER}" == "packetbeat"){ tagAndPush('packetbeat')