Skip to content

Commit

Permalink
Merge pull request #33 from oleg-nenashev/JENKINS-49074-jep-200
Browse files Browse the repository at this point in the history
[JENKINS-49074] - Update Parent POM and make the plugin compatible with Jenkins 2.102+
  • Loading branch information
gschueler committed Jan 24, 2018
2 parents aa26bd0 + 7270df2 commit 555f070
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 12 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -4,5 +4,4 @@ addons:
- rdjenkins
hostname: rdjenkins
jdk:
- openjdk7
- oraclejdk8
2 changes: 2 additions & 0 deletions Jenkinsfile
@@ -0,0 +1,2 @@
// Build the plugin using https://github.com/jenkins-infra/pipeline-library
buildPlugin()
36 changes: 25 additions & 11 deletions pom.xml
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.580.1</version>
<version>3.2</version>
</parent>

<artifactId>rundeck</artifactId>
Expand All @@ -22,7 +22,11 @@
</scm>

<properties>
<jenkins.version>1.625.3</jenkins.version>
<java.level>7</java.level>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- TODO: remove once FindBugs is fixed -->
<findbugs.failOnError>false</findbugs.failOnError>
</properties>

<developers>
Expand Down Expand Up @@ -77,14 +81,6 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
Expand Down Expand Up @@ -170,12 +166,18 @@
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.7.1</version>
<version>2.7.2</version>
</dependency>
<dependency>
<groupId>xalan</groupId>
<artifactId>serializer</artifactId>
<version>2.7.1</version>
<version>2.7.2</version>
</dependency>
<dependency>
<!-- Upper bounds between JTH and Xalan serializer which contains older version -->
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.4.01</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
Expand All @@ -193,6 +195,18 @@
<version>1.16</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>subversion</artifactId>
<version>2.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>ssh-credentials</artifactId>
<version>1.11</version>
<scope>test</scope>
</dependency>
</dependencies>

<!-- get every artifact through repo.jenkins-ci.org, which proxies all the artifacts that we need -->
Expand Down
10 changes: 10 additions & 0 deletions src/main/resources/META-INF/hudson.remoting.ClassFilter
@@ -0,0 +1,10 @@
# RundeckJobProjectLinkerAction
# Just a data structure
org.rundeck.api.domain.RundeckJob
# RundeckJobProjectLinkerAction: Name is very suspicious, but this is just a data structure. Runtime content is stored within ApiCall
org.rundeck.api.RundeckClient


# RundeckCause - RundeckExecution and nested data types
org.rundeck.api.domain.RundeckExecution
org.rundeck.api.domain.RundeckNode
1 change: 1 addition & 0 deletions src/main/resources/index.jelly
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<div>
This plugin is a Notifier (Publisher) that will talk to a <a href="http://www.rundeck.org">Rundeck</a> instance
(via its HTTP API) to schedule a job execution on Rundeck after a successful build on Jenkins.<br />
Expand Down
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<table style="margin-top: 1em; margin-left:1em;">
<tr>
Expand Down
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<a href="${it.urlName}" title="${it.displayName}">
<img width="16" height="16" title="${it.displayName}" src="${rootURL}${it.iconFileName}"/>
</a>
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">

<j:set var="instances" value="${descriptor.getRundeckInstances()}"/>
Expand Down
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<f:section title="Rundeck">
<f:entry title="Job cache" description="Rundeck job cache configuration">
Expand Down
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<f:nested>
<table style="width:100%">
Expand Down
@@ -1,3 +1,4 @@
<?jelly escape-by-default='true'?>
<div>
Triggers a build when we receive a WebHook notification from Rundeck.

Expand Down
@@ -1,15 +1,26 @@
package org.jenkinsci.plugins.rundeck;

import com.cloudbees.plugins.credentials.CredentialsDescriptor;
import com.cloudbees.plugins.credentials.CredentialsScope;
import com.cloudbees.plugins.credentials.common.StandardUsernameCredentials;
import com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials;
import com.cloudbees.plugins.credentials.common.UsernamePasswordCredentials;
import com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl;
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.FilePath;
import hudson.model.*;
import hudson.model.Cause.UpstreamCause;
import hudson.scm.CredentialsSVNAuthenticationProviderImpl;
import hudson.scm.SVNAuthenticationManager;
import hudson.scm.SubversionSCM;
import java.io.File;
import java.io.IOException;
import java.io.StringWriter;
import java.util.Arrays;
import java.util.Date;
import java.util.Properties;

import hudson.util.Secret;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.time.DateUtils;
import org.jenkinsci.plugins.rundeck.RundeckNotifier.RundeckExecutionBuildBadgeAction;
Expand All @@ -25,7 +36,11 @@
import org.rundeck.api.domain.RundeckExecution.ExecutionStatus;
import org.rundeck.api.domain.RundeckJob;
import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNErrorMessage;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.auth.ISVNAuthenticationProvider;
import org.tmatesoft.svn.core.auth.SVNAuthentication;
import org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager;
import org.tmatesoft.svn.core.wc.SVNClientManager;

/**
Expand Down Expand Up @@ -341,6 +356,12 @@ private SubversionSCM createScm() throws Exception {

private void addScmCommit(FilePath workspace, String commitMessage) throws Exception {
SVNClientManager svnm = SubversionSCM.createSvnClientManager((ISVNAuthenticationProvider)null);
SVNAuthenticationManager mgr = new SVNAuthenticationManager(new File(jenkins.root, ".svn"), "user", "password");
mgr.setAuthenticationProvider(new CredentialsSVNAuthenticationProviderImpl(
new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL,
"test-svn-creds", "Test SVN Credentials",
"user", "password")));
svnm.setAuthenticationManager(mgr);

FilePath newFilePath = workspace.child("new-file");
File newFile = new File(newFilePath.getRemote());
Expand Down

0 comments on commit 555f070

Please sign in to comment.