- Machine: preferably Linux over Windows, to avoid any weirdness between Cygwin and Git for Windows
- Oracle JDK 8 (see note in Installing Jenkins on Red Hat distributions about CentOS's default Java)
- Maven 3.2 or better
- A recent enough Git
- Make sure the
COMPUTERNAME
environment variable is defined, as the end-to-end tests rely on its presence. One can use the EnvInject plugin to set it during the execution of the release job.
- 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)
- A "Jenkins infrastructure" account. They have some sort of LDAP server that provides SSO for JIRA, Confluence and Artifactory.
- 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 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>
- 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. - 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.
- If you can log in to https://repo.jenkins-ci.org with your account, you're set to punch in those credentials in your
- A TFS server or a VSTS account, configured as per
Testing.md
- Pre-release. Perform these manual steps on your workstation:
- 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 VSTS account host name> -Dtfs_user_name=<user> -Dtfs_user_password=<password>
- 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.
- Fill in the categories of the
ReleaseNotes.md
template, usually in one of the following formats:- <Summary>. Thanks to @<GitHub user name> for pull request #<pull request number>.
- <Summary>, via pull request #<pull request number>.
- Decide on the release version and on the next development version, based on the rules of Semantic Versioning.
- Update
ReleaseNotes.md
with the release version and merge/push tomaster
. - Merge any "wiki" changes to
master
.
- Automated release. Create a Jenkins job as follows:
- General
- Check "This project is parameterised"
- String parameter releaseVersion
- String parameter developmentVersion
- Check "This project is parameterised"
- SCM
- Git
- Repository Url: git@github.com:jenkinsci/tfs-plugin.git
- Credentials: (select your previously-entered private key file)
- Name: origin
- Refspec: +refs/heads/master:refs/remotes/origin/master
- Branch Specifier: refs/heads/master
- Repository browser: githubweb
- Additional Behaviours:
- Clean before checkout
- Check out to specific local branch (to avoid "Git fatal: ref HEAD is not a symbolic ref" while using maven release plugin)
- Branch name: master
- Git
- Build Environment
- Add timestamps to the Console Output
- Inject environment variables to the build process
- COMPUTERNAME (the host name of the Jenkins node that will run the job)
- TFS_SERVER_NAME (the TFS host name or VSTS account host name)
- Use secret text(s) or file(s)
- TFS_USER_NAME and TFS_USER_PASSWORD are initialized from a credential
- Build. Add the following steps:
- "Shell script" step to check and prepare (filling in the blanks at the
git config
lines near the end)
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 git@github.com 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
- "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}
- "Maven" step to actually release
clean release:prepare release:perform --batch-mode -Dtag=tfs-${releaseVersion} -DreleaseVersion=${releaseVersion} -DdevelopmentVersion=${developmentVersion}
- "Shell script" step for post-release actions (filling in the blanks at the
git config
lines near the beginning)
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
- Files to archive:
tfs/target/tfs.hpi,ReleaseNotes.md,README.md,images/**
- "Shell script" step to check and prepare (filling in the blanks at the
- General
- Post-release. Perform these manual steps on your workstation:
- Download the artifacts from Jenkins
- Create a pull request from the update_documentation_for_$releaseVersion branch, then merge it.
- Edit the tag on GitHub:
- Copy-paste most of
ReleaseNotes.md
. - Upload the artifacts downloaded from Jenkins.
- Publish release.
- Copy-paste most of
- Update
README.md
. - Update affected issues with "Fixed in".
- 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