This is a quick guide for "Hot Deploying" the Jenkins-Testswarm plugin for testing.
Pre-requisite:
The following applications should be installed:
Step 1: Install Jenkins
Follow the steps on Installing Jenkins, for your particular operating system.
NOTE: This step is not needed Hot-Deploying the plugin, as an instance of Jenkins will be fetched by Maven and launched during deployment. This is, however, needed for running it standalone.
Step 2: Checkout the Jenkins-Testswarm plugin
Using GIT, clone the Jenkins-Testswarm plugin to the desired location on your system.
Example
git clone https://github.com/appendto/jenkins-testswarm.git
Step 3: Adjust Maven Settings
Using the configuration from Setting up Environment, update the .m2/.settings.xml file.
Notes
- If you have just installed maven and don't yet have an .m2 directory, you can run mvn install from anywhere on the command line. This will create it for you.
- If you don't have a .settings.xml file, you can just create one with the configuration mentioned above.
- You might also want to add mirrors, in case any of the main repositories in the pom.xml file are down.
<mirrors>
<mirror>
<id>repo.jenkins-ci.org</id>
<mirrorOf>m.g.o-public</mirrorOf>
<url>http://repo.jenkins-ci.org/public</url>
</mirror>
</mirrors>
Step 4: Eclipse
Install m2eclipse
The m2eclipse plugin is able to create Eclipse projects from maven pom.xml files.
- Open Eclipse
- Help > Install New Software ...
- Click "Add.."
- Enter a name for the plugin repository (e.g. m2eclipse)
- Enter the location:
- http://download.eclipse.org/technology/m2e/releases
- for eclipse 3.5.2 use, http://m2eclipse.sonatype.org/sites/m2e
- Click "OK"
- Select the Plugins to install and Click "Next"
- Continue following the prompts until installation is complete, and restart Eclipse
Create an Eclipse Project
Use the m2eclipse plugin to create an Eclipse project straight from the pom.xml file of the Jenkins-Testswarm plugin.
- Open Eclipse
- File > Import >Maven > Existing Maven Projects
- Click "Browse..."
- Choose the Jenkins-Testswarm clone you made in Step 2.
- The pom.xml should show up under Projects, Click "Finish"
- A new Eclipse project should have been created called testwarmbuilder
Hot Deploy / Debug
For testing purposes it is much easier to Hot Deploy the plugin to Jenkins, rather than having to manually build and install the plugin each time.
- Open Eclipse
- Ensure that testswarmbuilder is the selected project
- From the toolbar or context sensitive menu select Debug As > Maven Build
- Under the "Main" tab set the "Goals" to hpi:run
- Under the "Environment" tab create a new variable
- Click "New..."
- Set "Name" to MAVEN_OPTS
- Set "Value" to "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n"
- Click "OK"
- Click "Debug"
- A Jenkins instance with the plugin installed, should have been launched. In your web browser, navigate to your Jenkins instance to continue testing.
Notes
- After creating the Eclipse project, a background task to download Maven dependencies may start. Make sure to let all of the downloads complete.
- Debugging will attempt to load Jenkins on port 8080, if you already have an instance running there, you should stop it before debugging.
- On Ubuntu, if you ran the installation from Step 1, Jenkins is installed as a service that launches on OS load. You can control the service with the following commands:
- sudo service jenkins stop
- sudo service jenkins start
- sudo service jenkins restart
Comments (0)
You don't have permission to comment on this page.