From 952beca1794e76808cb87196624a5592d5eac8c7 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 11 Aug 2020 12:45:47 +0200 Subject: [PATCH 01/21] Control when to send email notifications (#692) --- .../groovy/NotifyBuildResultStepTests.groovy | 35 ++++++++++++++++--- vars/notifyBuildResult.groovy | 10 +++--- 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/src/test/groovy/NotifyBuildResultStepTests.groovy b/src/test/groovy/NotifyBuildResultStepTests.groovy index 954c9a7..2a528a2 100644 --- a/src/test/groovy/NotifyBuildResultStepTests.groovy +++ b/src/test/groovy/NotifyBuildResultStepTests.groovy @@ -158,8 +158,8 @@ class NotifyBuildResultStepTests extends ApmBasePipelineTest { @Test void testCustomisedEmailWithEmptyOrNull() throws Exception { def script = loadScript(scriptName) - assertTrue(script.customisedEmail('').equals('')) - assertTrue(script.customisedEmail(null).equals('')) + assertTrue(script.customisedEmail('').equals([])) + assertTrue(script.customisedEmail(null).equals([])) assertJobStatusSuccess() } @@ -169,7 +169,7 @@ class NotifyBuildResultStepTests extends ApmBasePipelineTest { env.REPO = 'foo' env.remove('JOB_NAME') def result = script.customisedEmail('build-apm@example.com') - assertTrue(result.equals('build-apm+foo@example.com')) + assertTrue(result.equals(['build-apm+foo@example.com'])) assertJobStatusSuccess() } @@ -178,7 +178,7 @@ class NotifyBuildResultStepTests extends ApmBasePipelineTest { def script = loadScript(scriptName) env.REPO = 'foo' env.JOB_NAME = 'folder1/folder2/foo' - assertTrue(script.customisedEmail('build-apm@example.com').equals('build-apm+folder1@example.com')) + assertTrue(script.customisedEmail('build-apm@example.com').equals(['build-apm+folder1@example.com'])) assertJobStatusSuccess() } @@ -187,10 +187,35 @@ class NotifyBuildResultStepTests extends ApmBasePipelineTest { def script = loadScript(scriptName) env.REPO = '' env.JOB_NAME = '' - assertTrue(script.customisedEmail('build-apm@example.com').equals('build-apm@example.com')) + assertTrue(script.customisedEmail('build-apm@example.com').equals(['build-apm@example.com'])) assertJobStatusSuccess() } + @Test + void test_email_without_NOTIFY_TO() throws Exception { + def script = loadScript(scriptName) + env.remove('NOTIFY_TO') + script.call(shouldNotify: true) + printCallStack() + assertFalse(assertMethodCallContainsPattern('log', 'notifyBuildResult: Notifying results by email.')) + } + + @Test + void test_email_with_NOTIFY_TO() throws Exception { + def script = loadScript(scriptName) + script.call(shouldNotify: true) + printCallStack() + assertTrue(assertMethodCallContainsPattern('log', 'notifyBuildResult: Notifying results by email.')) + } + + @Test + void test_email_with_to() throws Exception { + def script = loadScript(scriptName) + script.call(shouldNotify: true, to: ['foo@acme.com']) + printCallStack() + assertTrue(assertMethodCallContainsPattern('log', 'notifyBuildResult: Notifying results by email.')) + } + @Test void testRebuildWhenEnvIssueAlreadySet() throws Exception { def script = loadScript(scriptName) diff --git a/vars/notifyBuildResult.groovy b/vars/notifyBuildResult.groovy index 1475681..58384d7 100644 --- a/vars/notifyBuildResult.groovy +++ b/vars/notifyBuildResult.groovy @@ -44,7 +44,7 @@ def call(Map args = [:]) { stage('Reporting build status'){ def secret = args.containsKey('secret') ? args.secret : 'secret/observability-team/ci/jenkins-stats-cloud' def es = args.containsKey('es') ? args.es : getVaultSecret(secret: secret)?.data.url - def to = args.containsKey('to') ? args.to : [ customisedEmail(env.NOTIFY_TO)] + def to = args.containsKey('to') ? args.to : customisedEmail(env.NOTIFY_TO) def statsURL = args.containsKey('statsURL') ? args.statsURL : "https://ela.st/observabtl-ci-stats" def shouldNotify = args.containsKey('shouldNotify') ? args.shouldNotify : !isPR() && currentBuild.currentResult != "SUCCESS" @@ -54,7 +54,7 @@ def call(Map args = [:]) { data['emailRecipients'] = to data['statsUrl'] = statsURL def notificationManager = new NotificationManager() - if(shouldNotify){ + if(shouldNotify && !to?.empty){ log(level: 'DEBUG', text: 'notifyBuildResult: Notifying results by email.') notificationManager.notifyEmail(data) } @@ -135,12 +135,12 @@ def customisedEmail(String email) { } } if (suffix?.trim()) { - return email.replace('@', "+${suffix}@") + return [email.replace('@', "+${suffix}@")] } else { - return email + return [email] } } - return '' + return [] } def isGitCheckoutIssue() { From 9b1cafe1071c6df3f2e186ad5a9d2e0b81abb04f Mon Sep 17 00:00:00 2001 From: apmmachine Date: Wed, 12 Aug 2020 07:06:06 +0000 Subject: [PATCH 02/21] [maven-release-plugin] prepare release v1.1.131 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e5e9a45..4ef9780 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 co.elastic jenkins-library - 1.1.131-SNAPSHOT + 1.1.131 APM Pipeline Shared Library Pipeline Shared Library containing utility steps. https://github.com/elastic/apm-pipeline-library @@ -12,7 +12,7 @@ scm:git:git@github.com:elastic/apm-pipeline-library.git scm:git:git@github.com:elastic/apm-pipeline-library.git https://github.com/elastic/apm-pipeline-library - HEAD + v1.1.131 From b2e9c05b5ea84196ac3446022d0b07bce98ce66e Mon Sep 17 00:00:00 2001 From: apmmachine Date: Wed, 12 Aug 2020 07:06:13 +0000 Subject: [PATCH 03/21] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 4ef9780..e7f8a56 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 co.elastic jenkins-library - 1.1.131 + 1.1.132-SNAPSHOT APM Pipeline Shared Library Pipeline Shared Library containing utility steps. https://github.com/elastic/apm-pipeline-library @@ -12,7 +12,7 @@ scm:git:git@github.com:elastic/apm-pipeline-library.git scm:git:git@github.com:elastic/apm-pipeline-library.git https://github.com/elastic/apm-pipeline-library - v1.1.131 + HEAD From 1da495471ce25b8d7f1f5f910207a97fb80cec40 Mon Sep 17 00:00:00 2001 From: apmmachine Date: Wed, 12 Aug 2020 07:07:14 +0000 Subject: [PATCH 04/21] docs: update CHANGELOG.md --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b6fde8..3d33eb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## v1.1.131 (12/08/2020) + +#### 🐛 Bug Fixes + +- Control when to send email notifications [#692](https://github.com/elastic/apm-pipeline-library/pull/692) + +#### ⚙️ CI + +- feat: support passing custom build commands from the target project [#683](https://github.com/elastic/apm-pipeline-library/pull/683) +- fix: typo caused by keyboard strokes [#688](https://github.com/elastic/apm-pipeline-library/pull/688) +- [jjbb] beats mbp is not required in the apm-ci anymore [#690](https://github.com/elastic/apm-pipeline-library/pull/690) +- fix: add the mandatory tag argument [#686](https://github.com/elastic/apm-pipeline-library/pull/686) + ## v1.1.130 (21/07/2020) #### 🐛 Bug Fixes From 70d113852541cfd9f7bf79fa5a09443d3bbd6672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Fri, 14 Aug 2020 11:32:06 +0200 Subject: [PATCH 05/21] chore: add force parameter to the JJBB job for APM specs sync (#693) --- .ci/jobs/apm-update-gherkin-pipeline.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.ci/jobs/apm-update-gherkin-pipeline.yml b/.ci/jobs/apm-update-gherkin-pipeline.yml index 85b6517..a17f3ad 100644 --- a/.ci/jobs/apm-update-gherkin-pipeline.yml +++ b/.ci/jobs/apm-update-gherkin-pipeline.yml @@ -10,6 +10,10 @@ name: DRY_RUN_MODE default: false description: "If true, allows to execute this pipeline in dry run mode, without sending a PR." + - bool: + name: FORCE_SEND_PR + default: false + description: "If true, will force sending a PR." pipeline-scm: script-path: .ci/Jenkinsfile scm: From 5d906c8aa73d74c0f79c076c59f20b60227010c3 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 17 Aug 2020 11:16:20 +0200 Subject: [PATCH 06/21] Use real email account (#695) --- vars/setupAPMGitEmail.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/setupAPMGitEmail.groovy b/vars/setupAPMGitEmail.groovy index c1e6684..198822a 100644 --- a/vars/setupAPMGitEmail.groovy +++ b/vars/setupAPMGitEmail.groovy @@ -25,6 +25,6 @@ def call(Map params = [:]) { def flag = params.containsKey('global') ? (params.global ? '--global' : '') : '' sh(label: 'Git config', script: """ git config ${flag} user.name apmmachine - git config ${flag} user.email 58790750+apmmachine@users.noreply.github.com + git config ${flag} user.email infra-root+apmmachine@elastic.co """) } From 41a541d7f879d226ffb5c0108ea56bc421ec533b Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 17 Aug 2020 18:07:40 +0200 Subject: [PATCH 07/21] Fix opbeans-frontend release process (#697) --- src/test/groovy/OpbeansPipelineStepTests.groovy | 12 ++++++++++++ vars/opbeansPipeline.groovy | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/test/groovy/OpbeansPipelineStepTests.groovy b/src/test/groovy/OpbeansPipelineStepTests.groovy index 66f6ae5..05fd6cf 100644 --- a/src/test/groovy/OpbeansPipelineStepTests.groovy +++ b/src/test/groovy/OpbeansPipelineStepTests.groovy @@ -93,6 +93,18 @@ class OpbeansPipelineStepTests extends ApmBasePipelineTest { assertJobStatusSuccess() } + @Test + void test_when_tag_release_for_opbeans_frontend() throws Exception { + def script = loadScript(scriptName) + // When the tag release does match + env.BRANCH_NAME = '@elastic/apm-rum@1.0' + script.call() + printCallStack() + // Then publish shell step + assertTrue(assertMethodCallContainsPattern('sh', 'VERSION=agent-1.0 make publish')) + assertJobStatusSuccess() + } + @Test void test_getForkedRepoOrElasticRepo() throws Exception { def script = loadScript(scriptName) diff --git a/vars/opbeansPipeline.groovy b/vars/opbeansPipeline.groovy index cfc5027..31d455a 100644 --- a/vars/opbeansPipeline.groovy +++ b/vars/opbeansPipeline.groovy @@ -152,7 +152,7 @@ def call(Map pipelineParams) { when { anyOf { branch 'master' - tag pattern: 'v\\d+\\.\\d+.*', comparator: 'REGEXP' + tag pattern: '(v\\d+\\.\\d+|@).*', comparator: 'REGEXP' } } environment { @@ -165,6 +165,12 @@ def call(Map pipelineParams) { deleteDir() unstash 'source' dir(BASE_DIR){ + // opbeans-frontend uses a different tag versioning + script { + if (env.VERSION.contains('@')) { + env.VERSION = env.VERSION.replaceAll('.*@', 'agent-') + } + } dockerLogin(secret: "${DOCKERHUB_SECRET}", registry: 'docker.io') sh "VERSION=${env.VERSION} make publish" } From ec2709b5a5d7cc0e2d06035ef69e96203e90447b Mon Sep 17 00:00:00 2001 From: apmmachine Date: Mon, 17 Aug 2020 16:18:56 +0000 Subject: [PATCH 08/21] [maven-release-plugin] prepare release v1.1.132 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e7f8a56..7c18003 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 co.elastic jenkins-library - 1.1.132-SNAPSHOT + 1.1.132 APM Pipeline Shared Library Pipeline Shared Library containing utility steps. https://github.com/elastic/apm-pipeline-library @@ -12,7 +12,7 @@ scm:git:git@github.com:elastic/apm-pipeline-library.git scm:git:git@github.com:elastic/apm-pipeline-library.git https://github.com/elastic/apm-pipeline-library - HEAD + v1.1.132 From 23b3af05db9733f71d22d85806caa94cfc0eed18 Mon Sep 17 00:00:00 2001 From: apmmachine Date: Mon, 17 Aug 2020 16:19:05 +0000 Subject: [PATCH 09/21] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 7c18003..98ddfa6 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 co.elastic jenkins-library - 1.1.132 + 1.1.133-SNAPSHOT APM Pipeline Shared Library Pipeline Shared Library containing utility steps. https://github.com/elastic/apm-pipeline-library @@ -12,7 +12,7 @@ scm:git:git@github.com:elastic/apm-pipeline-library.git scm:git:git@github.com:elastic/apm-pipeline-library.git https://github.com/elastic/apm-pipeline-library - v1.1.132 + HEAD From 133e9eb7c9d05fdc93b659be9041261ea69b01f4 Mon Sep 17 00:00:00 2001 From: apmmachine Date: Mon, 17 Aug 2020 16:20:07 +0000 Subject: [PATCH 10/21] docs: update CHANGELOG.md --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d33eb7..6d9cff5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## v1.1.132 (17/08/2020) + +#### 🐛 Bug Fixes + +- Fix opbeans-frontend release process [#697](https://github.com/elastic/apm-pipeline-library/pull/697) +- Use real email account [#695](https://github.com/elastic/apm-pipeline-library/pull/695) + ## v1.1.131 (12/08/2020) #### 🐛 Bug Fixes From 81de66d93d9c81adecbf180014555e9708413edb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Mon, 17 Aug 2020 18:50:59 +0200 Subject: [PATCH 11/21] chore: include schedule in JJBB for APM specs sync (#696) * chore: include schedule in JJBB for APM specs sync * chore: rename file to represent any kind of specs --- ...e-gherkin-pipeline.yml => apm-update-specs-pipeline.yml} | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename .ci/jobs/{apm-update-gherkin-pipeline.yml => apm-update-specs-pipeline.yml} (75%) diff --git a/.ci/jobs/apm-update-gherkin-pipeline.yml b/.ci/jobs/apm-update-specs-pipeline.yml similarity index 75% rename from .ci/jobs/apm-update-gherkin-pipeline.yml rename to .ci/jobs/apm-update-specs-pipeline.yml index a17f3ad..1470405 100644 --- a/.ci/jobs/apm-update-gherkin-pipeline.yml +++ b/.ci/jobs/apm-update-specs-pipeline.yml @@ -1,8 +1,8 @@ --- - job: - name: apm-shared/apm-update-gherkin-pipeline + name: apm-shared/apm-update-specs-pipeline display-name: APM Update Specs - description: Send PRs to the subscribed APM Agents if the gherkin files are modified, triggered for the master branch for the elastic/apm project + description: Send PRs to the subscribed APM Agents if the spec files (Gherkin and JSON) are modified, triggered for the master branch for the elastic/apm project project-type: pipeline view: APM-CI parameters: @@ -26,3 +26,5 @@ credentials-id: f6c7695a-671e-4f4f-a331-acdce44ff9ba branches: - 'master' + triggers: + - timed: 'H H(4-5) * * 1,5' From b542b84a91aa19d9f2aed68de20a510b373fe5cb Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 18 Aug 2020 10:04:53 +0200 Subject: [PATCH 12/21] fix read only env variable (#698) --- vars/opbeansPipeline.groovy | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vars/opbeansPipeline.groovy b/vars/opbeansPipeline.groovy index 31d455a..e63f5e5 100644 --- a/vars/opbeansPipeline.groovy +++ b/vars/opbeansPipeline.groovy @@ -168,11 +168,13 @@ def call(Map pipelineParams) { // opbeans-frontend uses a different tag versioning script { if (env.VERSION.contains('@')) { - env.VERSION = env.VERSION.replaceAll('.*@', 'agent-') + env.TAG = env.VERSION.replaceAll('.*@', 'agent-') + } else { + env.TAG = env.VERSION } } dockerLogin(secret: "${DOCKERHUB_SECRET}", registry: 'docker.io') - sh "VERSION=${env.VERSION} make publish" + sh "VERSION=${env.TAG} make publish" } } } From 66c822842225898e41c8fe1b28643c77255d6609 Mon Sep 17 00:00:00 2001 From: apmmachine Date: Tue, 18 Aug 2020 09:59:15 +0000 Subject: [PATCH 13/21] [maven-release-plugin] prepare release v1.1.133 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 98ddfa6..a957d71 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 co.elastic jenkins-library - 1.1.133-SNAPSHOT + 1.1.133 APM Pipeline Shared Library Pipeline Shared Library containing utility steps. https://github.com/elastic/apm-pipeline-library @@ -12,7 +12,7 @@ scm:git:git@github.com:elastic/apm-pipeline-library.git scm:git:git@github.com:elastic/apm-pipeline-library.git https://github.com/elastic/apm-pipeline-library - HEAD + v1.1.133 From 80765816bb6b17cb4f9b79a9367558e7f17f7a73 Mon Sep 17 00:00:00 2001 From: apmmachine Date: Tue, 18 Aug 2020 09:59:22 +0000 Subject: [PATCH 14/21] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index a957d71..1e2a44d 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 co.elastic jenkins-library - 1.1.133 + 1.1.134-SNAPSHOT APM Pipeline Shared Library Pipeline Shared Library containing utility steps. https://github.com/elastic/apm-pipeline-library @@ -12,7 +12,7 @@ scm:git:git@github.com:elastic/apm-pipeline-library.git scm:git:git@github.com:elastic/apm-pipeline-library.git https://github.com/elastic/apm-pipeline-library - v1.1.133 + HEAD From 989f3c8e66bd5bc72d3b292ba9e4d300bb592774 Mon Sep 17 00:00:00 2001 From: apmmachine Date: Tue, 18 Aug 2020 10:00:23 +0000 Subject: [PATCH 15/21] docs: update CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d9cff5..ed5482e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v1.1.133 (18/08/2020) + +#### 🐛 Bug Fixes + +- fix read only env variable [#698](https://github.com/elastic/apm-pipeline-library/pull/698) + ## v1.1.132 (17/08/2020) #### 🐛 Bug Fixes From e6723dc3695eb63b9ca98bacdddac4c46531e25d Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Tue, 18 Aug 2020 17:06:18 +0200 Subject: [PATCH 16/21] [CI] git commit with correct user.email (#700) --- .ci/Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index d2cce7e..bfbad61 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -25,6 +25,8 @@ pipeline { NOTIFY_TO = credentials('notify-to') PIPELINE_LOG_LEVEL = 'DEBUG' MAVEN_CONFIG = "${params.MAVEN_CONFIG}" + LANG = "C.UTF-8" + LC_ALL = "C.UTF-8" } options { timeout(time: 1, unit: 'HOURS') From b0f1527efe22c0bef25eb04b83776add845fcad6 Mon Sep 17 00:00:00 2001 From: apmmachine Date: Tue, 18 Aug 2020 15:18:12 +0000 Subject: [PATCH 17/21] [maven-release-plugin] prepare release v1.1.134 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 1e2a44d..56751b9 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 co.elastic jenkins-library - 1.1.134-SNAPSHOT + 1.1.134 APM Pipeline Shared Library Pipeline Shared Library containing utility steps. https://github.com/elastic/apm-pipeline-library @@ -12,7 +12,7 @@ scm:git:git@github.com:elastic/apm-pipeline-library.git scm:git:git@github.com:elastic/apm-pipeline-library.git https://github.com/elastic/apm-pipeline-library - HEAD + v1.1.134 From 69b95a8103b3e5f726937afdc65b688c977e4cd4 Mon Sep 17 00:00:00 2001 From: apmmachine Date: Tue, 18 Aug 2020 15:18:19 +0000 Subject: [PATCH 18/21] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 56751b9..57184c7 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 co.elastic jenkins-library - 1.1.134 + 1.1.135-SNAPSHOT APM Pipeline Shared Library Pipeline Shared Library containing utility steps. https://github.com/elastic/apm-pipeline-library @@ -12,7 +12,7 @@ scm:git:git@github.com:elastic/apm-pipeline-library.git scm:git:git@github.com:elastic/apm-pipeline-library.git https://github.com/elastic/apm-pipeline-library - v1.1.134 + HEAD From 06c62f097a3109e82d977b3292df1e77ce92ff26 Mon Sep 17 00:00:00 2001 From: apmmachine Date: Tue, 18 Aug 2020 15:19:23 +0000 Subject: [PATCH 19/21] docs: update CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed5482e..4b24627 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v1.1.134 (18/08/2020) + +#### ⚙️ CI + +- [CI] git commit with correct user.email [#700](https://github.com/elastic/apm-pipeline-library/pull/700) + ## v1.1.133 (18/08/2020) #### 🐛 Bug Fixes From 8a5c2c2e46fa0664e1922f903b1c6d50f9ea2eec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 19 Aug 2020 11:14:09 +0200 Subject: [PATCH 20/21] chore: convert regular pipeline for APM to mbp (#699) * chore: convert regular pipeline for APM to mbp * chore: rename param for readability * Revert "chore: rename param for readability" This reverts commit d6d2658419e1fb6fe96a68fddcba3d68b660fba4. * chore: enrich param message --- .ci/jobs/apm-update-specs-mbp.yml | 51 ++++++++++++++++++++++++++ .ci/jobs/apm-update-specs-pipeline.yml | 30 --------------- 2 files changed, 51 insertions(+), 30 deletions(-) create mode 100644 .ci/jobs/apm-update-specs-mbp.yml delete mode 100644 .ci/jobs/apm-update-specs-pipeline.yml diff --git a/.ci/jobs/apm-update-specs-mbp.yml b/.ci/jobs/apm-update-specs-mbp.yml new file mode 100644 index 0000000..1b25f09 --- /dev/null +++ b/.ci/jobs/apm-update-specs-mbp.yml @@ -0,0 +1,51 @@ +--- +- job: + name: apm-shared/apm-update-specs-mbp + display-name: APM Update Specs + description: Send PRs to the subscribed APM Agents if the spec files (Gherkin and JSON) are modified, triggered for the master branch for the elastic/apm project + view: APM-CI + project-type: multibranch + script-path: .ci/Jenkinsfile + parameters: + - bool: + name: DRY_RUN_MODE + default: false + description: "If true, allows to execute this pipeline in dry run mode, without sending a PR." + - bool: + name: FORCE_SEND_PR + default: false + description: "If true, will force sending a PR, although it could be affected by the value off the DRY_RUN parameter: if the later is true, a message will be printed in the console." + scm: + - github: + branch-discovery: no-pr + discover-pr-forks-strategy: merge-current + discover-pr-forks-trust: permission + discover-pr-origin: merge-current + discover-tags: false + notification-context: 'apm-ci' + repo: apm + repo-owner: elastic + credentials-id: 2a9602aa-ab9f-4e52-baf3-b71ca88469c7-UserAndToken + ssh-checkout: + credentials: f6c7695a-671e-4f4f-a331-acdce44ff9ba + build-strategies: + - regular-branches: true + - change-request: + ignore-target-only-changes: true + clean: + after: true + before: true + prune: true + shallow-clone: true + depth: 4 + do-not-fetch-tags: true + submodule: + disable: false + recursive: true + parent-credentials: true + timeout: 100 + timeout: '15' + use-author: true + wipe-workspace: 'True' + triggers: + - timed: 'H H(4-5) * * 1,5' diff --git a/.ci/jobs/apm-update-specs-pipeline.yml b/.ci/jobs/apm-update-specs-pipeline.yml deleted file mode 100644 index 1470405..0000000 --- a/.ci/jobs/apm-update-specs-pipeline.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -- job: - name: apm-shared/apm-update-specs-pipeline - display-name: APM Update Specs - description: Send PRs to the subscribed APM Agents if the spec files (Gherkin and JSON) are modified, triggered for the master branch for the elastic/apm project - project-type: pipeline - view: APM-CI - parameters: - - bool: - name: DRY_RUN_MODE - default: false - description: "If true, allows to execute this pipeline in dry run mode, without sending a PR." - - bool: - name: FORCE_SEND_PR - default: false - description: "If true, will force sending a PR." - pipeline-scm: - script-path: .ci/Jenkinsfile - scm: - - git: - url: git@github.com:elastic/apm.git - refspec: +refs/heads/*:refs/remotes/origin/* - wipe-workspace: 'True' - name: origin - shallow-clone: true - credentials-id: f6c7695a-671e-4f4f-a331-acdce44ff9ba - branches: - - 'master' - triggers: - - timed: 'H H(4-5) * * 1,5' From eb158ec3f1c5b75750f7b776080f7772ce4d4441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 19 Aug 2020 13:06:02 +0200 Subject: [PATCH 21/21] fix: remove params from JJB definition (#701) * fix: remove section so that JJBB is able to create the job * chore: use same JJB image --- .ci/jobs/apm-update-specs-mbp.yml | 9 --------- local/test-jjbb.sh | 5 +++-- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/.ci/jobs/apm-update-specs-mbp.yml b/.ci/jobs/apm-update-specs-mbp.yml index 1b25f09..4561467 100644 --- a/.ci/jobs/apm-update-specs-mbp.yml +++ b/.ci/jobs/apm-update-specs-mbp.yml @@ -6,15 +6,6 @@ view: APM-CI project-type: multibranch script-path: .ci/Jenkinsfile - parameters: - - bool: - name: DRY_RUN_MODE - default: false - description: "If true, allows to execute this pipeline in dry run mode, without sending a PR." - - bool: - name: FORCE_SEND_PR - default: false - description: "If true, will force sending a PR, although it could be affected by the value off the DRY_RUN parameter: if the later is true, a message will be printed in the console." scm: - github: branch-discovery: no-pr diff --git a/local/test-jjbb.sh b/local/test-jjbb.sh index 4f0426b..5ada23f 100755 --- a/local/test-jjbb.sh +++ b/local/test-jjbb.sh @@ -3,6 +3,7 @@ set -eo pipefail ## Further details: https://github.com/elastic/infra/blob/master/flavortown/jjbb/README.md#how-do-i-test-changes-locally +JJB_IMAGE="osmman/jenkins-job-builder:3.1.0" TMPFOLDER=$(mktemp -q -d /tmp/pre-commit.XXXXXX) LOG_LEVEL="error" @@ -53,7 +54,7 @@ docker run -t --rm --user "$(id -u):$(id -g)" \ -v "${TMPFOLDER}:/jjbb" \ -w '/jjbb' \ -e HOME=/tmp \ - osmman/jenkins-job-builder:3.1.0 -l "${LOG_LEVEL}" test "${BASENAME}" > "${JJB_REPORT}" + ${JJB_IMAGE} -l "${LOG_LEVEL}" test "${BASENAME}" > "${JJB_REPORT}" # shellcheck disable=SC2181 if [ $? -gt 0 ] ; then @@ -71,5 +72,5 @@ docker run -t --rm --user "$(id -u):$(id -g)" \ -w '/jjbb' \ -v "$(pwd)/local/jenkins_jobs.ini":/etc/jenkins_jobs/jenkins_jobs.ini \ --network local_apm-pipeline-library \ - osmman/jenkins-job-builder:3.0.2 -l "${LOG_LEVEL}" update "${BASENAME}" + ${JJB_IMAGE} -l "${LOG_LEVEL}" update "${BASENAME}" printf '\tpassed\n'