Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to download the client directory from the plugin installed in Jenkins #62

Merged
merged 2 commits into from
Feb 21, 2018

Conversation

sbaudoin
Copy link
Contributor

Add ability to download the client directory from the plugin with the URL http://jenkins_server:port/swarm/swarm-client.jar. This will simplify the availability and distribution of the client (especially in an enterprise context) and permit the creation of very simple, generic Docker containers for Jenkins slaves that would just download the client from Jenkins, making sure it is always up-to-date with Jenkins (in short, no more need to build a client container for every release of the client).

… URL http://jenkins_server:port/swarm/swarm-client.jar
Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, you do not use PluginImpl due to the permission requirements, right?

I would rather serve the client from the JENKINS-URL/swarm/swarm-client.jar or so. It reserves some extensibility for other needs

}

// serve static resources
public void doDynamic(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add @Restricted(NoExternalUse.class) to indicate it is not a public API

@sbaudoin
Copy link
Contributor Author

Hello,

Yes, the purpose is to have the client being downloadable publicly to ease its distribution so I couldn't use the PluginImpl class.

Annotation added.

@oleg-nenashev
Copy link
Member

@sylv704

I would rather serve the client from the JENKINS-URL/swarm/swarm-client.jar or so. It reserves some extensibility for other needs

WDYT?

@sbaudoin
Copy link
Contributor Author

sbaudoin commented Dec 27, 2017

Well, I may be wrong but this is what I did (so I agree): the JAR is downloadable from the URL JENKINS_URL/swarm/swarm-client.jar: the method DownloadClientAction.getUrlName() returns swarm, meaning that the resources embedded by the plugin are accessible via the URL JENKINS_URL/swarm/, and in the main pom.xml file the client JAR is renamed to swarm-client.jar. If you look at the other PR I did earlier today you'll see in the client's Dockerfile that the JAR is downloaded from http://jenkins:8080/swarm/swarm-client.jar.

@oleg-nenashev
Copy link
Member

Right, my bad

@oleg-nenashev oleg-nenashev self-requested a review February 2, 2018 23:01
@oleg-nenashev
Copy link
Member

Looks good to me after manual testing. Will try to integrate it into the next release

@oleg-nenashev
Copy link
Member

CC @Wadeck .
I would like to take some more time for testing this thing on my instance. Will try to release the master today and to release the rest later

@oleg-nenashev
Copy link
Member

After https://jenkins.io/security/advisory/2018-02-14/ it is fine to release it.

@oleg-nenashev oleg-nenashev merged commit 9f3044c into jenkinsci:master Feb 21, 2018
@albers
Copy link
Member

albers commented Feb 23, 2018

@sylv704 Really cool feature, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants