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

sbaudoin commented Dec 16, 2017

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 left a comment

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 {

This comment has been minimized.

Copy link
@oleg-nenashev

oleg-nenashev Dec 22, 2017

Member

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

@sbaudoin

This comment has been minimized.

Copy link
Contributor Author

sbaudoin commented Dec 27, 2017

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

This comment has been minimized.

Copy link
Member

oleg-nenashev commented Dec 27, 2017

@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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

oleg-nenashev commented Feb 2, 2018

Right, my bad

@oleg-nenashev oleg-nenashev self-requested a review Feb 2, 2018
@oleg-nenashev

This comment has been minimized.

Copy link
Member

oleg-nenashev commented Feb 2, 2018

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

@oleg-nenashev

This comment has been minimized.

Copy link
Member

oleg-nenashev commented Feb 6, 2018

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

This comment has been minimized.

Copy link
Member

oleg-nenashev commented Feb 21, 2018

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
1 check passed
1 check passed
continuous-integration/jenkins/pr-merge This commit looks good
Details
@albers

This comment has been minimized.

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
Projects
None yet
3 participants
You can’t perform that action at this time.