Skip to content

Commit ead2e54

Browse files
authored
Merge pull request jenkinsci#48 from jglick/exec-only
Delete non-exec-based agent factories
2 parents 8037497 + b9e1715 commit ead2e54

File tree

11 files changed

+9
-946
lines changed

11 files changed

+9
-946
lines changed

README.md

Lines changed: 6 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
This plugin allows you to provide SSH credentials to builds via a
44
ssh-agent in Jenkins.
55

6+
This is convenient in some cases.
7+
Alternately, you can use the generic `withCredentials` step to bind an SSH private key to a temporary file
8+
and then pass that to commands that require it,
9+
for example using the `-i` option to `ssh` or `scp`.
10+
611
# Requirements
712

8-
Currently all **Windows** nodes (including the master) on which this
9-
plugin will be used must have the [Apache Tomcat Native
10-
libraries](http://tomcat.apache.org/native-doc/)
11-
installed. As of 1.0 should be unnecessary for Unix nodes. As of 1.14
12-
unnecessary if `ssh-agent` is installed.
13+
You need to have the `ssh-agent` executable installed on the agent.
1314

1415
# Configuring
1516

@@ -31,67 +32,6 @@ And then your build will have those credentials available, e.g.
3132

3233
From a Pipeline job, use the `sshagent` step.
3334

34-
# Installation Example: MacOSX (10.7.5)
35-
36-
**Irrelevant in 1.14+ when `ssh-agent` is available in the path.**
37-
38-
Prerequisites:
39-
40-
- JDK7. The tomcat native libraries target the java 7 version.
41-
- APR - this seems to be preinstalled in /usr/lib/apr.
42-
43-
Note that tomcat itself is not needed. This works fine with winstone
44-
(just running jenkins jar from command line).
45-
46-
Download and extract the tomcat native
47-
library: <http://tomcat.apache.org/download-native.cgi>
48-
49-
tar -zxvf tomcat-native-1.1.XX-src.tar.gz
50-
51-
Build the native library:
52-
53-
cd tomcat-native-1.1.XX/jni/native
54-
55-
./configure --with-apr=/usr/bin/apr-1-config
56-
57-
make && sudo make install
58-
59-
Build the java interface:
60-
61-
cd ..
62-
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home
63-
64-
ant build
65-
66-
ant jar
67-
68-
Copy the output jar somewhere suitable for inclusion in your jenkins
69-
CLASSPATH.
70-
71-
Set environment variables prior to starting jenkins:
72-
73-
export DYLD_LIBRARY_PATH=/usr/local/apr/lib
74-
export CLASSPATH=/path/to/tomcat-native-1.1.XX.jar
75-
java -jar jenkins.war
76-
77-
Additionally, you might have to add bouncycastle to your JCE providers.
78-
If you attempt to use the plugin and get an exception like the
79-
following:
80-
81-
java.lang.IllegalStateException: BouncyCastle must be registered as a JCE provider
82-
83-
Then you may need to configure the jce provider. One way is to do this
84-
right in the JRE, so if Jenkins is using the same jdk as above, edit
85-
86-
/Library/Java/JavaVirtualMachines/jdk1.7.0\_17.jdk/Contents/Home/jre/lib/security/java.security,
87-
and add the following line:
88-
89-
security.provider.11=org.bouncycastle.jce.provider.BouncyCastleProvider
90-
91-
Then, restart jenkins.
92-
93-
From there, configure using the instructions above.
94-
9535
# Version History
9636

9737
For new versions, see [GitHub releases](https://github.com/jenkinsci/ssh-agent-plugin/releases).

pom.xml

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<parent>
3030
<groupId>org.jenkins-ci.plugins</groupId>
3131
<artifactId>plugin</artifactId>
32-
<version>4.12</version>
32+
<version>4.16</version>
3333
<relativePath />
3434
</parent>
3535

@@ -78,21 +78,6 @@
7878

7979
<dependencies>
8080
<!-- regular dependencies -->
81-
<dependency>
82-
<groupId>org.apache.sshd</groupId>
83-
<artifactId>sshd-core</artifactId>
84-
<version>1.7.0</version>
85-
</dependency>
86-
<dependency>
87-
<groupId>tomcat</groupId>
88-
<artifactId>tomcat-apr</artifactId>
89-
<version>5.5.23</version>
90-
</dependency>
91-
<dependency>
92-
<groupId>com.cloudbees.util</groupId>
93-
<artifactId>jnr-unixsocket-nodep</artifactId>
94-
<version>0.3.1</version>
95-
</dependency>
9681
<dependency>
9782
<groupId>org.jenkins-ci.plugins.workflow</groupId>
9883
<artifactId>workflow-step-api</artifactId>
@@ -107,11 +92,6 @@
10792
<groupId>org.jenkins-ci.plugins</groupId>
10893
<artifactId>ssh-credentials</artifactId>
10994
</dependency>
110-
<dependency>
111-
<groupId>org.jenkins-ci.plugins</groupId>
112-
<artifactId>bouncycastle-api</artifactId>
113-
<version>2.16.3</version>
114-
</dependency>
11595
<!-- jenkins dependencies -->
11696
<!-- test dependencies -->
11797
<dependency>
@@ -142,7 +122,7 @@
142122
<dependency>
143123
<groupId>io.jenkins.tools.bom</groupId>
144124
<artifactId>bom-2.222.x</artifactId>
145-
<version>20</version>
125+
<version>26</version>
146126
<scope>import</scope>
147127
<type>pom</type>
148128
</dependency>
@@ -152,13 +132,10 @@
152132
<build>
153133
<plugins>
154134
<plugin>
155-
<!-- critical because sshd needs to be loaded first, otherwise will just bail out -->
156-
<!-- https://www.jenkins.io/doc/developer/plugin-development/dependencies-and-class-loading/ -->
157135
<groupId>org.jenkins-ci.tools</groupId>
158136
<artifactId>maven-hpi-plugin</artifactId>
159137
<extensions>true</extensions>
160138
<configuration>
161-
<pluginFirstClassLoader>true</pluginFirstClassLoader>
162139
<compatibleSinceVersion>1.5</compatibleSinceVersion>
163140
</configuration>
164141
</plugin>

src/main/java/com/cloudbees/jenkins/plugins/sshagent/RemoteHelper.java

Lines changed: 0 additions & 61 deletions
This file was deleted.

src/main/java/com/cloudbees/jenkins/plugins/sshagent/SSHAgentStepExecution.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ private void initRemoteAgent() throws IOException, InterruptedException {
147147
listener.getLogger().println(Messages.SSHAgentBuildWrapper_UsingCredentials(SSHAgentBuildWrapper.description(userPrivateKey)));
148148
}
149149

150+
// TODO UI could be streamlined now that there is only one impl
150151
listener.getLogger().println("[ssh-agent] Looking for ssh-agent implementation...");
151152
Map<String, Throwable> faults = new LinkedHashMap<String, Throwable>();
152153
for (RemoteAgentFactory factory : Jenkins.getActiveInstance().getExtensionList(RemoteAgentFactory.class)) {

0 commit comments

Comments
 (0)