Skip to content

Commit

Permalink
Merge pull request #1 from nikita-andreev/job_dsl
Browse files Browse the repository at this point in the history
Job dsl
  • Loading branch information
nikita-andreev authored Jul 26, 2019
2 parents 16e47da + d54cb83 commit 17c0f3a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 12 deletions.
31 changes: 19 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<relativePath />
</parent>
<artifactId>applitools-eyes</artifactId>
<version>1.8-SNAPSHOT</version>
<version>1.9-SNAPSHOT</version>
<packaging>hpi</packaging>
<name>Applitools Eyes Plugin</name>
<url>https://wiki.jenkins-ci.org/display/JENKINS/Applitools+Eyes+Plugin</url>
Expand All @@ -32,8 +32,9 @@
<!-- Baseline Jenkins version you use to build the plugin. Users must have this version or newer to run. -->
<jenkins.version>1.625.3</jenkins.version>
<!-- Java Level to use. Java 7 required when using core >= 1.612 -->
<java.level>7</java.level>
<java.level>8</java.level>
<plugins.workflow.version>1.15</plugins.workflow.version>
<plugins.job-dsl.version>1.52</plugins.job-dsl.version>
</properties>

<developers>
Expand All @@ -45,16 +46,22 @@
</developers>

<dependencies>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-step-api</artifactId>
<version>${plugins.workflow.version}</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-job</artifactId>
<version>${plugins.workflow.version}</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-step-api</artifactId>
<version>${plugins.workflow.version}</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-job</artifactId>
<version>${plugins.workflow.version}</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>job-dsl</artifactId>
<version>${plugins.job-dsl.version}</version>
<optional>true</optional>
</dependency>
</dependencies>
<repositories>
<repository>
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/com/applitools/jenkins/ApplitoolsJobDsl.java
Original file line number Diff line number Diff line change
@@ -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);
}

}

0 comments on commit 17c0f3a

Please sign in to comment.