From 71f403d5669914ba44c305ce7db8fd8e7a778572 Mon Sep 17 00:00:00 2001 From: Nikita Andreyev Date: Tue, 18 Jun 2019 15:25:28 +0300 Subject: [PATCH 1/5] APPLITOOLS_SEQUENCE_NAME env var --- src/main/java/com/applitools/jenkins/ApplitoolsCommon.java | 2 +- .../com/applitools/jenkins/ApplitoolsEnvironmentUtil.java | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/applitools/jenkins/ApplitoolsCommon.java b/src/main/java/com/applitools/jenkins/ApplitoolsCommon.java index 0ced13c..b4c8d5c 100644 --- a/src/main/java/com/applitools/jenkins/ApplitoolsCommon.java +++ b/src/main/java/com/applitools/jenkins/ApplitoolsCommon.java @@ -57,7 +57,7 @@ public static void buildEnvVariablesForExternalUsage(Map env, fi String projectName = build.getParent().getDisplayName(); String batchId = ApplitoolsStatusDisplayAction.generateBatchId(projectName, build.getNumber(), build.getTimestamp()); String batchName = projectName; - ApplitoolsEnvironmentUtil.outputVariables(listener, env, serverURL, batchName, batchId); + ApplitoolsEnvironmentUtil.outputVariables(listener, env, serverURL, batchName, batchId, projectName); } diff --git a/src/main/java/com/applitools/jenkins/ApplitoolsEnvironmentUtil.java b/src/main/java/com/applitools/jenkins/ApplitoolsEnvironmentUtil.java index 2d6b2d6..5b5619d 100644 --- a/src/main/java/com/applitools/jenkins/ApplitoolsEnvironmentUtil.java +++ b/src/main/java/com/applitools/jenkins/ApplitoolsEnvironmentUtil.java @@ -10,10 +10,11 @@ */ public class ApplitoolsEnvironmentUtil { - public static void outputVariables(final TaskListener listener, Map env, String serverURL, String batchName, String batchId) { + public static void outputVariables(final TaskListener listener, Map env, String serverURL, String batchName, String batchId, String projectName) { final String APPLITOOLS_BATCH_NAME = "BATCH_NAME"; final String APPLITOOLS_BATCH_ID = "BATCH_ID"; final String APPLITOOLS_PROJECT_SERVER_URL = "PROJECT_SERVER_URL"; + final String APPLITOOLS_SEQUENCE_NAME = "SEQUENCE_NAME"; listener.getLogger().println("Creating Applitools environment variables:"); @@ -27,6 +28,10 @@ public static void outputVariables(final TaskListener listener, Map env, String key, String value, boolean overwrite) { From 9e2636ebe4954ae4e14d8a9e588f3118d58b8d6a Mon Sep 17 00:00:00 2001 From: Nikita Andreyev Date: Fri, 26 Jul 2019 17:29:04 +0300 Subject: [PATCH 2/5] Job DSL extension: wrappers { Applitools('http://your.server') } --- pom.xml | 29 ++++++++++++------- .../applitools/jenkins/ApplitoolsJobDsl.java | 20 +++++++++++++ 2 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 src/main/java/com/applitools/jenkins/ApplitoolsJobDsl.java diff --git a/pom.xml b/pom.xml index 681d5ce..9707301 100644 --- a/pom.xml +++ b/pom.xml @@ -32,8 +32,9 @@ 1.625.3 - 7 + 8 1.15 + 1.52 @@ -45,16 +46,22 @@ - - org.jenkins-ci.plugins.workflow - workflow-step-api - ${plugins.workflow.version} - - - org.jenkins-ci.plugins.workflow - workflow-job - ${plugins.workflow.version} - + + org.jenkins-ci.plugins.workflow + workflow-step-api + ${plugins.workflow.version} + + + org.jenkins-ci.plugins.workflow + workflow-job + ${plugins.workflow.version} + + + org.jenkins-ci.plugins + job-dsl + ${plugins.job-dsl.version} + true + diff --git a/src/main/java/com/applitools/jenkins/ApplitoolsJobDsl.java b/src/main/java/com/applitools/jenkins/ApplitoolsJobDsl.java new file mode 100644 index 0000000..5857c98 --- /dev/null +++ b/src/main/java/com/applitools/jenkins/ApplitoolsJobDsl.java @@ -0,0 +1,20 @@ +package com.applitools.jenkins; + +import hudson.Extension; +import javaposse.jobdsl.dsl.helpers.wrapper.WrapperContext; +import javaposse.jobdsl.plugin.ContextExtensionPoint; +import javaposse.jobdsl.plugin.DslExtensionMethod; + +@Extension(optional = true) +public class ApplitoolsJobDsl extends ContextExtensionPoint { + @DslExtensionMethod(context = WrapperContext.class) + public Object Applitools(String serverUrl) { + return new ApplitoolsBuildWrapper(serverUrl); + } + + @DslExtensionMethod(context = WrapperContext.class) + public Object Applitools() { + return new ApplitoolsBuildWrapper(ApplitoolsCommon.APPLITOOLS_DEFAULT_URL); + } + +} From 9b1b16d773ab172e22dae544319a1202bd1854a9 Mon Sep 17 00:00:00 2001 From: Nikita Andreyev Date: Fri, 26 Jul 2019 17:47:16 +0300 Subject: [PATCH 3/5] POM.xml fixes --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 60ac146..a9f7e9d 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 1.625.3 - 8 + 7 1.15 1.52 From 4eb98d170992abf9d59bc374481db2ad2e2ea706 Mon Sep 17 00:00:00 2001 From: Nikita Andreyev Date: Mon, 29 Jul 2019 15:13:15 +0300 Subject: [PATCH 4/5] APPLITOOLS_BATCH_SEQUENCE environment variable --- .../java/com/applitools/jenkins/ApplitoolsEnvironmentUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/applitools/jenkins/ApplitoolsEnvironmentUtil.java b/src/main/java/com/applitools/jenkins/ApplitoolsEnvironmentUtil.java index 5b5619d..6a3f345 100644 --- a/src/main/java/com/applitools/jenkins/ApplitoolsEnvironmentUtil.java +++ b/src/main/java/com/applitools/jenkins/ApplitoolsEnvironmentUtil.java @@ -14,7 +14,7 @@ public static void outputVariables(final TaskListener listener, Map Date: Mon, 29 Jul 2019 15:31:05 +0300 Subject: [PATCH 5/5] APPLITOOLS_BATCH_SEQUENCE environment variable --- .../com/applitools/jenkins/ApplitoolsEnvironmentUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/applitools/jenkins/ApplitoolsEnvironmentUtil.java b/src/main/java/com/applitools/jenkins/ApplitoolsEnvironmentUtil.java index 6a3f345..05bd929 100644 --- a/src/main/java/com/applitools/jenkins/ApplitoolsEnvironmentUtil.java +++ b/src/main/java/com/applitools/jenkins/ApplitoolsEnvironmentUtil.java @@ -14,7 +14,7 @@ public static void outputVariables(final TaskListener listener, Map