-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into trivalik-patch-1
- Loading branch information
Showing
524 changed files
with
15,321 additions
and
1,626 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
/.settings | ||
/target | ||
/workspaces | ||
/work | ||
/.project | ||
/.classpath | ||
.settings | ||
**/target | ||
**/workspaces | ||
**/work | ||
.project | ||
.classpath | ||
/.idea | ||
/*.iml | ||
**/*.iml |
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,10 @@ | ||
pipeline { | ||
agent any | ||
stages { | ||
stage('Build') { | ||
steps { | ||
buildPlugin() | ||
} | ||
} | ||
} | ||
} |
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,9 @@ | ||
These notes are for release **(to be determined)**. | ||
Other releases and their notes can be found at the [tfs-plugin GitHub Releases](https://github.com/jenkinsci/tfs-plugin/releases) page. | ||
|
||
* Major: | ||
* TODO | ||
|
||
* Minor: | ||
* TODO | ||
|
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,156 @@ | ||
Pre-requisites | ||
============== | ||
|
||
1. Machine: preferably Linux over Windows, to avoid any weirdness between Cygwin and Git for Windows | ||
1. Oracle JDK 8 (see note in [Installing Jenkins on Red Hat distributions](https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Red+Hat+distributions) about CentOS's default Java) | ||
1. Maven 3.2 or better | ||
1. A recent enough Git | ||
1. Make sure the `COMPUTERNAME` environment variable is defined, as the end-to-end tests rely on its presence. One can use the [EnvInject plugin](https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin) to set it during the execution of the release job. | ||
1. A GitHub clone you can pull from and push to non-interactively. (Consider configuring GitHub with a public key and use the SSH protocol for everything) | ||
1. A "Jenkins infrastructure" account. They have some sort of LDAP server that provides SSO for JIRA, Confluence and Artifactory. | ||
1. If you can log in to https://repo.jenkins-ci.org with your account, you're set to punch in those credentials in your `~/.m2/settings.xml` file: | ||
```xml | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<settings | ||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" | ||
xmlns="http://maven.apache.org/SETTINGS/1.1.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<servers> | ||
<server> | ||
<id>repo.jenkins-ci.org</id> | ||
<username>TODO</username> | ||
<password>TODO</password> | ||
</server> | ||
</servers> | ||
</settings> | ||
``` | ||
2. A great test is to try to perform a `mvn deploy`, which should attempt to upload some files to the snapshot repo and will need those credentials. | ||
3. If you're worried about putting your "Jenkins infrastructure" password in plain-text in that file, Maven has a password encryption facility that relies on a master password in another file. Presumably, you secure access to the 2nd file by placing it on a thumbdrive that you carry with you when you're not at your computer, etc. | ||
1. A TFS server or a Azure DevOps account, configured as per `Testing.md` | ||
|
||
Release | ||
======= | ||
|
||
1. Pre-release. Perform these manual steps on your workstation: | ||
1. Run a full build, with all its end-to-end tests; it takes about 5 minutes: | ||
``` | ||
mvn clean verify --batch-mode -Dtfs_server_name=<TFS host name or Azure DevOps account host name> -Dtfs_user_name=<user> -Dtfs_user_password=<password> | ||
``` | ||
2. Look at the commits since the last release by going to https://github.com/jenkinsci/tfs-plugin/releases and clicking the "XX commits to master since this release" link. It will be easiest to surf the associated pull requests, so hit Ctrl+F, search for "Merge pull request" and Ctrl+click every #XXX link to the right of the highlights. | ||
3. Fill in the categories of the `ReleaseNotes.md` template, usually in one of the following formats: | ||
1. <Summary>. Thanks to @<GitHub user name> for pull request #<pull request number>. | ||
2. <Summary>, via pull request #<pull request number>. | ||
4. Decide on the release version and on the next development version, based on the rules of [Semantic Versioning](http://semver.org/). | ||
5. Update `ReleaseNotes.md` with the release version and merge/push to `master`. | ||
6. Merge any "wiki" changes to `master`. | ||
2. Automated release. Create a Jenkins job as follows: | ||
1. General | ||
1. Check "This project is parameterised" | ||
1. String parameter **releaseVersion** | ||
2. String parameter **developmentVersion** | ||
2. SCM | ||
1. Git | ||
1. Repository Url: **[email protected]:jenkinsci/tfs-plugin.git** | ||
2. Credentials: (select your previously-entered private key file) | ||
3. Name: **origin** | ||
4. Refspec: **+refs/heads/master:refs/remotes/origin/master** | ||
5. Branch Specifier: **refs/heads/master** | ||
6. Repository browser: **githubweb** | ||
7. Additional Behaviours: | ||
1. Clean before checkout | ||
2. Check out to specific local branch (to avoid ["Git fatal: ref HEAD is not a symbolic ref" while using maven release plugin](https://stackoverflow.com/a/21184154/)) | ||
1. Branch name: **master** | ||
3. Build Environment | ||
1. Add timestamps to the Console Output | ||
2. Inject environment variables to the build process | ||
1. **COMPUTERNAME** (the host name of the Jenkins node that will run the job) | ||
2. **TFS_SERVER_NAME** (the TFS host name or Azure DevOps account host name) | ||
3. Use secret text(s) or file(s) | ||
1. **TFS_USER_NAME** and **TFS_USER_PASSWORD** are initialized from a credential | ||
4. Build. Add the following steps: | ||
1. "Shell script" step to check and prepare (filling in the blanks at the `git config` lines near the end) | ||
```bash | ||
set +e | ||
|
||
# verify releaseVersion and developmentVersion | ||
if [[ "$releaseVersion" != +([0-9])\.+([0-9])\.+([0-9]) ]] | ||
then | ||
echo "ERROR: '$releaseVersion' is not a valid releaseVersion" | ||
exit 1 | ||
fi | ||
|
||
if [[ "$developmentVersion" != +([0-9])\.+([0-9])\.+([0-9])-SNAPSHOT ]] | ||
then | ||
echo "ERROR: '$developmentVersion' is not a valid developmentVersion" | ||
exit 1 | ||
fi | ||
|
||
|
||
# test SSH connection to Git | ||
ssh -Tv [email protected] | ||
if [[ $? != "1" ]] | ||
then | ||
echo "ERROR: Unable to connect to GitHub via SSH" | ||
exit 1 | ||
fi | ||
|
||
git config --local user.name '<your full name>' | ||
git config --local user.email '<your e-mail address>' | ||
|
||
exit 0 | ||
``` | ||
2. "Maven" step as a dry-run, running all tests and performing a SNAPSHOT deploy | ||
``` | ||
deploy | ||
dependency:go-offline | ||
--batch-mode | ||
-Dtfs_server_name=${TFS_SERVER_NAME} | ||
-Dtfs_user_name=${TFS_USER_NAME} | ||
-Dtfs_user_password=${TFS_USER_PASSWORD} | ||
``` | ||
3. "Maven" step to actually release | ||
``` | ||
clean | ||
release:prepare | ||
release:perform | ||
--batch-mode | ||
-Dtag=tfs-${releaseVersion} | ||
-DreleaseVersion=${releaseVersion} | ||
-DdevelopmentVersion=${developmentVersion} | ||
``` | ||
4. "Shell script" step for post-release actions (filling in the blanks at the `git config` lines near the beginning) | ||
```bash | ||
cd target/checkout | ||
git config --local user.name '<your full name>' | ||
git config --local user.email '<your e-mail address>' | ||
|
||
git checkout -b update_documentation_for_$releaseVersion origin/master | ||
|
||
cat > ReleaseNotes.md <<EndOfReleaseNotes | ||
These notes are for release **(to be determined)**. | ||
Other releases and their notes can be found at the [tfs-plugin GitHub Releases](https://github.com/jenkinsci/tfs-plugin/releases) page. | ||
|
||
* Major: | ||
* TODO | ||
* Minor: | ||
* TODO | ||
|
||
EndOfReleaseNotes | ||
git commit -a -m "Clear out the release notes for the next release" | ||
|
||
git push origin update_documentation_for_$releaseVersion | ||
``` | ||
5. Files to archive: | ||
``` | ||
tfs/target/tfs.hpi,ReleaseNotes.md,README.md,images/** | ||
``` | ||
3. Post-release. Perform these manual steps on your workstation: | ||
1. Download the artifacts from Jenkins | ||
2. Create a pull request from the **update_documentation_for_$releaseVersion** branch, then merge it. | ||
3. Edit the tag on GitHub: | ||
1. Copy-paste most of `ReleaseNotes.md`. | ||
2. Upload the artifacts downloaded from Jenkins. | ||
3. Publish release. | ||
4. Update `README.md`. | ||
5. Update affected issues with "Fixed in". | ||
6. Check the update mirror after about a day, to make sure the new version was replicated across the CDN: http://updates.jenkins-ci.org/update-center.json |
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,80 @@ | ||
Contributing to the Team Foundation Server plugin for Jenkins | ||
============================================================= | ||
|
||
## Building Sources | ||
This is a Maven project with Java sources. The mvn package command will produce an HPI file that is the Jenkins Plugin file that will need to be installed on your Jenkins Server. | ||
- SET JAVA_HOME to the location of the JRE to build with (JRE 1.8 works) | ||
- 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 | ||
|
||
## Using IntelliJ IDEA | ||
To use Intellij IDEA as the editor for this project simply do the following after getting sources: | ||
1) Open the tfs-plugin folder (root folder) in IntelliJ (I installed IntelliJ 17 community edition from https://www.jetbrains.com/idea/) | ||
2) Go to File->Project Structure and click on Project | ||
3) Specify the Project SDK (Java 1.8 works) | ||
|
||
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 "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 (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) | ||
1) Command Line | ||
|
||
` | ||
hpi:run -Djetty.port=8090 -Dhudson.plugins.tfs.telemetry.isDeveloperMode=true | ||
` | ||
|
||
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. 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. | ||
1) Install Docker for your OS (https://www.docker.com/community-edition) | ||
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 | ||
` | ||
|
||
- NOTES: | ||
- Note that this command line avoids port 8080 (the default) in case you have VSO deployed as well | ||
- 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) | ||
1) Setup Jenkins | ||
1) Go to http://localhost:9191 | ||
1) Enter the admin password | ||
1) Install default plugins | ||
1) Run Jenkins | ||
1) Install Plugin Manually | ||
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 | ||
|
||
` | ||
docker stop localJenkins | ||
docker container prune | ||
` | ||
|
||
Then repeat step 2 and 3 above |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.