Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 45 additions & 23 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>3.56</version>
<relativePath />
<version>4.51</version>
<relativePath/>
</parent>

<groupId>org.jenkins-ci.plugins</groupId>
Expand All @@ -18,8 +19,10 @@
<url>https://github.com/jenkinsci/katalon-plugin</url>

<properties>
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
<jenkins.baseline>2.346</jenkins.baseline>
<!-- 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>
<jenkins.version>${jenkins.baseline}.3</jenkins.version>
<java.level>8</java.level>
<!-- Other properties you may want to use:
~ java.level: set to 6 if your jenkins.version <= 1.611 ~ jenkins-test-harness.version: Jenkins Test Harness version you use to test the plugin. For Jenkins version >= 1.580.1 use JTH 2.0 or higher.
Expand All @@ -32,6 +35,29 @@
<utils.version>1.0.17</utils.version>
<httpclient.version>4.5.13</httpclient.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-${jenkins.baseline}.x</artifactId>
<version>1763.v092b_8980a_f5e</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-${jenkins.baseline}.x</artifactId>
<version>1763.v092b_8980a_f5e</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.4</version>
</dependency>
</dependencies>
</dependencyManagement>

<!-- The default licence for Jenkins OSS Plugins is MIT. Substitute for the applicable one if needed. -->

Expand All @@ -47,20 +73,12 @@
<url>https://www.katalon.com</url>
</organization>

<developers>
<developer>
<id>devalex88</id>
<name>Alex</name>
<email>dev.alex.88@gmail.com</email>
</developer>
</developers>

<scm>
<connection>scm:git:git://github.com/jenkinsci/${project.artifactId}-plugin.git</connection>
<developerConnection>scm:git:git@github.com:jenkinsci/${project.artifactId}-plugin.git</developerConnection>
<url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
<tag>HEAD</tag>
</scm>
<connection>scm:git:https://github.com/jenkinsci/${project.artifactId}-plugin.git</connection>
<developerConnection>scm:git:git@github.com:jenkinsci/${project.artifactId}-plugin.git</developerConnection>
<url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
<tag>HEAD</tag>
</scm>

<repositories>
<repository>
Expand All @@ -79,12 +97,17 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>junit</artifactId>
<version>${junit.plugin.version}</version>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- <dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-test-harness</artifactId>
</dependency> -->
<!-- <dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-test-harness</artifactId>
</dependency> -->
<dependency>
<groupId>com.katalon</groupId>
<artifactId>utils</artifactId>
Expand All @@ -98,7 +121,6 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plain-credentials</artifactId>
<version>1.3</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
import org.apache.commons.lang3.StringUtils;
import org.jenkinsci.Symbol;
import org.jenkinsci.plugins.plaincredentials.StringCredentials;
import org.kohsuke.stapler.*;
import org.kohsuke.stapler.AncestorInPath;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.interceptor.RequirePOST;

import javax.annotation.Nonnull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

public class ExecuteKatalonStudioHelper {

@SuppressWarnings("NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE")
public static boolean executeKatalon(
FilePath workspace,
EnvVars buildEnvironment,
Expand All @@ -26,6 +27,10 @@ public static boolean executeKatalon(
String xvfbConfiguration) {
Logger logger = new JenkinsLogger(taskListener);
try {
if (launcher == null || launcher.getChannel() == null) {
logger.info("Launcher channel is null");
return false;
}
return launcher.getChannel().call(new MasterToSlaveCallable<Boolean, Exception>() {
@Override
public Boolean call() throws Exception {
Expand All @@ -41,17 +46,22 @@ public Boolean call() throws Exception {
buildEnvironment.entrySet()
.forEach(entry -> environmentVariables.put(entry.getKey(), entry.getValue()));
return KatalonUtils.executeKatalon(
logger,
version,
location,
workspaceLocation,
executeArgs,
x11Display,
xvfbConfiguration,
environmentVariables);
logger,
version,
location,
workspaceLocation,
executeArgs,
x11Display,
xvfbConfiguration,
environmentVariables);
} else {
logger.info("Workspace location is null");
return false;
}
} else {
logger.info("Workspace is null");
return false;
}
return true;
}
});
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.katalon.jenkins.plugin.entity.*;
import com.katalon.jenkins.plugin.entity.BuildInfo;
import com.katalon.jenkins.plugin.entity.Job;
import com.katalon.jenkins.plugin.entity.JobStatus;
import com.katalon.jenkins.plugin.entity.TestProject;
import com.katalon.utils.Logger;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpHeaders;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.katalon.jenkins.plugin.helper;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.katalon.jenkins.plugin.entity.Plan;
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/index.jelly
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?jelly escape-by-default='true'?>
<div>
Execute Katalon Studio in Jenkins
</div>