-
Notifications
You must be signed in to change notification settings - Fork 99
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
New Docker approach to test the client #64
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
988a06b
Add ability to download the client directory from the plugin with the…
sbaudoin 4fa5ac5
Add annotation @Restricted(NoExternalUse.class) as requested by the p…
sbaudoin 6f391f1
Outillage build et test
sbaudoin e15b15b
Optimize build and test cycle with an existing Jenkins master + a Swa…
sbaudoin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
all: build install run | ||
|
||
build: | ||
mvn clean package | ||
|
||
install: | ||
rm -rf jenkins_home/plugins/swarm | ||
cp plugin/target/swarm.hpi jenkins_home/plugins | ||
|
||
run: | ||
# echo 2.0 > jenkins_home/jenkins.install.UpgradeWizard.state | ||
echo -n 2.0 > jenkins_home/jenkins.install.InstallUtil.lastExecVersion | ||
docker-compose up -d | ||
|
||
stop: | ||
docker-compose stop | ||
|
||
clean: stop | ||
find jenkins_home -type f ! -name '.keepit' ! -name 'configure-security.groovy' -exec rm -f {} \; | ||
find jenkins_home -depth -mindepth 1 -type d ! -name 'init.groovy.d' ! -name 'plugins' -exec rm -rf {} \; | ||
|
||
deep-clean: clean | ||
docker-compose down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import jenkins.model.Jenkins | ||
import hudson.security.SecurityRealm | ||
|
||
def instance = Jenkins.getInstance() | ||
instance.setSecurityRealm(SecurityRealm.NO_AUTHENTICATION) | ||
instance.save() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
plugin/src/main/java/hudson/plugins/swarm/DownloadClientAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package hudson.plugins.swarm; | ||
|
||
import hudson.Extension; | ||
import hudson.model.UnprotectedRootAction; | ||
import jenkins.model.Jenkins; | ||
import org.kohsuke.stapler.StaplerRequest; | ||
import org.kohsuke.stapler.StaplerResponse; | ||
import org.kohsuke.accmod.Restricted; | ||
import org.kohsuke.accmod.restrictions.NoExternalUse; | ||
|
||
import javax.servlet.ServletException; | ||
import java.io.IOException; | ||
|
||
@Extension | ||
public class DownloadClientAction implements UnprotectedRootAction { | ||
public String getIconFileName() { | ||
return null; | ||
} | ||
|
||
public String getDisplayName() { | ||
return null; | ||
} | ||
|
||
public String getUrlName() { | ||
return "swarm"; | ||
} | ||
|
||
// serve static resources | ||
@Restricted(NoExternalUse.class) | ||
public void doDynamic(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { | ||
Jenkins.getActiveInstance().getPlugin("swarm").doDynamic(req, rsp); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs the Jenkins image to be running when you build the image. IMHO it is not required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the contrary: the purpose of this is to test the ability to download the Swarm client from Jenkins, so a Jenkins server must be up and running with the Swarm plugin (see the other PR I did)