Skip to content

Commit

Permalink
Update Contributing file
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Young committed Jul 18, 2017
1 parent 1e9f8fe commit 69b0a77
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This is a Maven project with Java sources. The mvn package command will produce
- Clone the repo from https://github.com/jenkinsci/tfs-plugin.git
- change dir to the tfs-plugin folder
- run "mvn package"
- If you do not have Maven installed yet, here are [instructions](http://www.mkyong.com/maven/how-to-install-maven-in-windows/) on how to install it on Windows.
- Initial build will have to download lots of libraries. This could take a few minutes.
- This produces tfs-plugin\tfs\target\tfs.hpi

Expand All @@ -18,13 +19,13 @@ To use Intellij IDEA as the editor for this project simply do the following afte

You should now be able to build from within IntelliJ
- NOTE to build the hpi file you will have to
- bring up the Maven Projects tool window (View->Tool Windows->Maven Projects) and click the "run maven goal" button
- Then type in "package" in the goal text box
- bring up the Maven Projects tool window (View->Tool Windows->Maven Projects) and click the "execute maven goal" button
- Then type "package" in the "Command Line" text box (of the Execute Maven Goal dialog)

## Debugging the Plugin
See https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial for information on how to debug the plugin.
From within IntelliJ:
1) Create a new Run configuration
1) Create a new Run configuration (Run | Edit Configurations... | + )
1) Type = Maven
1) Name = run hpi
1) Working directory should be the full path to "../tfs-plugin/tfs" (NOTE this is NOT the root folder)
Expand All @@ -37,16 +38,18 @@ From within IntelliJ:
1) or use whatever port you want
1) On the Runner tab
1) Environment Variables == MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n
1) To set the environment variables, make sure you uncheck 'Use project settings' first. Then use the '...' to set the variable.

1) Run or Debug this configuration using the play and debug icons (top right)
1) Set any breakpoints you want in IntelliJ
1) Navigate to http://localhost:8090/jenkins

Note: this runs Jenkins on your local OS not in a docker image. As such, any configurations you make are preserved between runs.
Note: this runs Jenkins on your local OS not in a Docker image. As such, any configurations you make are preserved between runs. You do not need to have Jenkins previously installed locally (IntelliJ will run Jenkins from a local JAR file).

## Installing Jenkins Locally for Manual Testing
The easiest method is to run Jenkins in a docker image.
The easiest method is to run Jenkins in a Docker image.
1) Install Docker for your OS (https://www.docker.com/community-edition)
1) Install and run the jenkins image
1) Install and run the Jenkins image

`
docker run --name localJenkins -p 9191:9191 -p 50001:50001 --env "JENKINS_OPTS=--httpPort=9191" --env JENKINS_SLAVE_AGENT_PORT=50001 --env hudson.plugins.tfs.telemetry.isDeveloperMode=true jenkins
Expand All @@ -57,7 +60,7 @@ The easiest method is to run Jenkins in a docker image.
- Look in the output for the admin password
- The output sent to the console is also where you will see any logger output
- Note the environment variable "hudson.plugins.tfs.telemetry.isDeveloperMode". It is important to set this variable so that AppInsights data is sent to right key
- This installs a linux jenkins server on Docker (NOT one based on Windows or the host OS)
- This installs a Linux Jenkins server on Docker (NOT one based on Windows or the host OS)
1) Setup Jenkins
1) Go to http://localhost:9191
1) Enter the admin password
Expand All @@ -67,7 +70,7 @@ The easiest method is to run Jenkins in a docker image.
1) Go to http://localhost:9191/pluginManager/advanced
1) Browse to the tfs.hpi file and Upload it
1) To update the plugin, repeat steps 1 and 2 and then restart Jenkins by going to http://localhost:9191/restart
1) To Stop Jenkins and start from scratch
1) To stop Jenkins and start from scratch

`
docker stop localJenkins
Expand Down

0 comments on commit 69b0a77

Please sign in to comment.