Skip to content

Commit

Permalink
Improved help for connect methods.
Browse files Browse the repository at this point in the history
Prerequisites for all 3 methods are now bullet-pointed lists.
SSH now specifies that login details are needed as per ssh-slaves
plugin.
JNLP now specifies that slave.jar is needed.
JNLP's entrypoint argument help improved to make it clear that the
multi-line string needs to be expanded before being edited.
Example of custom command now mentions that it requires wget.
Also, moved details of the default setting to the bottom of the help
text.
  • Loading branch information
pjdarton committed May 29, 2018
1 parent 2c703f7 commit ad68a22
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:f="/lib/form">

<f:block>
<span class="info">Prerequisites:</span> Docker image must have <a href="https://go.java">Java</a> installed. Also entrypoint must be able to accept jenkins slave connection parameters. <a href="https://github.com/jenkinsci/docker-jnlp-slave">See jenkins/docker-jnlp-slave as an example</a>
<span class="info">Prerequisites:</span>
<ul>
<li>
Docker image must have <a href="https://go.java">Java</a> installed.
</li>
<li>
Entrypoint must be able to accept jenkins slave connection parameters.
See
<a href="https://github.com/jenkinsci/docker-jnlp-slave">jenkins/docker-jnlp-slave</a>
as an example.
</li>
</ul>
</f:block>

<f:entry title="${%User}" field="user">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:f="/lib/form">

<f:block>
<span class="info">Prerequisites:</span> Docker image must have <a href="https://go.java">Java</a> installed,
and Jenkins master has to be accessible over network <em>from</em> container.
<span class="info">Prerequisites:</span>
<ul>
<li>
Jenkins master has to be accessible over network <em>from</em> the container.
</li>
<li>
Docker image must have <a href="https://go.java">Java</a> installed.
</li>
<li>
Docker image must <em>either</em> have <tt>slave.jar</tt> pre-installed <em>or</em> have its entry point code download it.
</li>
</ul>
</f:block>

<f:entry title="${%User}" field="user">
Expand All @@ -15,7 +25,7 @@
</f:entry>

<f:entry title="${%EntryPoint Arguments}" field="entryPointArgumentsString">
<f:expandableTextbox />
<f:expandableTextbox />
</f:entry>

<f:property field="jnlpLauncher"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
<div>
<p>
Arguments to be passed to the container's entry point.
</p>
<p>
<b>NOTE:</b>
This field is a multi-line string.
Each (non-empty) line defines a seperate argument.
If you require more than one argument
(e.g. copying one of the examples below)
then you will need to expand the field,
otherwise you'll end up with one long line instead of multiple lines.
</p>
<p>
Limited variable substitution (using $${VARIABLE_NAME} syntax) is carried out on the configured strings prior to starting the container.
Expand All @@ -15,22 +23,31 @@
</j:forEach>
</dl>
</p>
<p>
For example, if you are using a custom container that has
<tt>java</tt>
and
<tt>wget</tt>
installed but does not have
<tt>slave.jar</tt>
pre-installed then you could use the following instead:
<blockquote>
<tt>sh</tt><br/>
<tt>-c</tt><br/>
<tt>wget $${JENKINS_URL}jnlpJars/slave.jar &amp;&amp; java -jar slave.jar -jnlpUrl $${JENKINS_URL}computer/$${NODE_NAME}/slave-agent.jnlp -secret $${JNLP_SECRET}</tt><br/>
</blockquote>
</p>
<p>
If this field is left blank then it defaults to arguments
suitable for the standard
Jenkins JNLP Agent Docker image,
<a href="https://github.com/jenkinsci/docker-jnlp-slave">jenkins/jnlp-slave</a>, namely:
<a href="https://github.com/jenkinsci/docker-jnlp-slave">jenkins/jnlp-slave</a>,
which are:
<blockquote>
<j:forEach var="entry" items="${app.getDescriptor('io.jenkins.docker.connector.DockerComputerJNLPConnector').defaultEntryPointArguments}">
<tt>${entry}</tt><br/>
</j:forEach>
</blockquote>
If you are using a custom container that does not use the same entry point then you could use the following arguments instead:
<blockquote>
<tt>sh</tt><br/>
<tt>-c</tt><br/>
<tt>wget $${JENKINS_URL}jnlpJars/slave.jar &amp;&amp; java -jar slave.jar -jnlpUrl $${JENKINS_URL}computer/$${NODE_NAME}/slave-agent.jnlp -secret $${JNLP_SECRET}</tt><br/>
</blockquote>
</p>
</div>
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,30 @@
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:f="/lib/form" >

<f:block>
<span class="info">Prerequisites:</span> Docker image must have <a href="https://www.openssh.com/">sshd</a> and a JDK installed.
<span class="info">Prerequisites:</span>
<ul>
<li>
The docker container's mapped SSH port,
typically a port on the docker host,
has to be accessible over network <em>from</em> the master.
</li>
<li>
Docker image must have
<a href="https://www.openssh.com/">sshd</a>
installed.
</li>
<li>
Docker image must have
<a href="https://go.java">Java</a>
installed.
</li>
<li>
Log in details configured as per
<a href="https://plugins.jenkins.io/ssh-slaves">ssh-slaves</a>
plugin.
</li>
</ul>

</f:block>

<f:dropdownDescriptorSelector title="SSH key" field="sshKeyStrategy" />
Expand Down

0 comments on commit ad68a22

Please sign in to comment.