Monday, 18 December 2017

Creating Multiple Artifacts in a Single Build

Sometime you may want to create multiple artifacts in a build for separate each project output into different artifact. This question was asked in a forum “To create CI/CD pipeline to deploy web application and windows service on different VMs there is a need to create separate artifacts, for both project. How artifacts for all projects can be published separately in a CI pipeline ?” To answer that question, let’s look at very simple implementation possibility in VSTS/TFS builds.

You can use multiple, Publish tasks to create multiple artifacts in a single build definition.

For example lets say, you have below, as your current artifacts for a single project, comprising of _PublishedWebsites\MVS5WebApp (XCopy deployable website) and _PublishedWebsites\MVS5WebApp_Package (web deploy package).

Current Artifactimage

If you want to separate these two, into two artifacts, you can use two Publish Artifact tasks as shown below, each one specifying exact path to publish (this path does not support wildcards, you just have to specify the folder you need to publish).

Publish website XCopy deploy contentimage

Publish Web Deploy Packageimage

This will give you output as shown below with two artifactsimage

In this example, you have only used the Publish Artifacts task and created two artifacts using a single web site project. You can do same for two project scenario. If you want to use wild card to filter more files, before publish you can use "Copy File" task multiple times as required.

No comments:

Popular Posts