For those of you familiar with JFrog Artifactory and its integration with CI servers, you know that we have plugins for Jenkins, TeamCity and Bamboo that integrate and capture information from the CI server to provide full traceability between artifacts and their origin. We also have an integration with MsBuild which allows you to capture information about deployed artifacts, resolve NuGet dependencies and environment data associated with MsBuild runs. But building an embedded plugin for TFS was not possible in the past.
If you have been following Microsoft, you would have noticed that there has been a revolution, happening at Microsoft in the last 2 years. Their position in 2001 was illustrated by the idea that “open source is an intellectual property destroyer. I can’t imagine something that could be worse than this for the software business and the intellectual-property business.” ( “Microsoft Raps Open-Source Approach,”. CNET News, Ben Charny, 3 May 2001)). Funny no?
However they changed their minds, and started to open their ecosystem. In the last 2 years they open sourced .Net, Mono, MsBuild, released a free and multi-platform IDE, and more recently they made a great change in Team Foundation Server 2015 (TFS2015). With this new release, Microsoft created a marketplace and the capability to build extensions for TFS and Visual Studio Team Services (VSTS which was first named Visual Studio Online). These extensions can contain new tasks for build and release definition but you can also create new components (tab, menu, action …) embedded in the TFS/VSTS UI.
This blog is not about how this new version of TFS is great (and it is) but about what how JFrog has leveraged it. We could not miss the opportunity to jump on it (we are frogs after all).
Our main goal was to provide an integration between VSTS/TFS and JFrog Artifactory as we did with other CI servers with the capability to publish any kind of artifacts, capture build information, and provide seamless navigation between both platforms. Luckily our existing MsBuild plugin worked fine on VSTS with minor changes due to inconsistent environment variables. We also realized that our Maven and Gradle plugins continued to work as well.
The first thing we added was a generic deployer which allows you to deploy any artifact from your build to Artifactory with all related build information.This deployer is a custom task written in powershell and using our CLI.
Then we added some custom components to visualize build information gathered from Artifactory in the TFS build result view ( the build and publish to Artifactory along with the release history are also in this view). From this same view we also added the capability to promote a build in Artifactory and to navigate to the detailed build information in Artifactory. This part proved especially frustrating since the VSTS APIs does not allow you to get same information that you can access from a custom task ( for e.g.,you cannot have the list of service endpoints used in tasks.)
TFS also provides a Release Management feature which allow you to create the staging to production environment, inject your artifacts in it, and test it. JFrog Artifactory excels in moving artifacts and managing their lifecycles and so we had to be part of it.We added also two more tasks. The first one allows you to download all artifacts generated by a build based on its latest version and status.from Artifactory. The second is a promotion task to promote a build during your automated pipeline.
With this integration you can now achieve the following workflow with VSTS/TFS2015 and Artifactory:
- Launch a build in VSTS/TFS
- Download all dependencies from Artifactory (whether you are using maven, gradle, npm, nugget,…)
- Perform the build
- Deploy to Artifactory
- Trigger a Release definition
- In release management, create a new environment (eg : staging)
- Download the latest artifacts from Artifactory and inject them in your environment
- Test them
- Promote your build
- In release management, create the next environment
Visualize all the release history in build result tab in VSTS/TFS
You can install this extension for VSTS or download it for TFS2015 from the official marketplace.
All the instructions to work with it are available on our wiki.