0
votes

I use TFS 2017(15.117) on premise with a build & release def. My build pushes the build result (zip package) to the artifactstaging directory on the build server.

In my release def I have 2 tasks (Manage IIS & Deploy IIS) and I want to make use of the artifactstaging directory on the build server to reference the zip pacakge but I don't know how to do this using the variables...

How can this be done using the same agent pool and queue that is also used by the build definition ?

2
See if this helpsSam
Seems you are getting the similar error as this one github.com/Microsoft/vsts-tasks/issues/4152 ?PatrickLu-MSFT
The issue is that the WinRM Deploy IIS App task in TFS gives a hint that the .zip web deploy package file should be at a file share on the target machine or on a UNC path. Because the artifact download is at the build server, the path is not available for the app server... I am trying to copy the web deploy package as a file copy task to a share on the app serverPatrick Peters
@PatrickPeters If so, you could try to use Deploy: Windows Machine File Copy which could copy the .zip pacakge in drop folders of build server to app server. About the variable take a look at: Build.ArtifactStagingDirectory The local path on the agent where any artifacts are copied to before being pushed to their destination. : c:\agent\_work\1\aPatrickLu-MSFT

2 Answers

1
votes

You have to use the Publish Artifact task. Look at one of the built-in templates for examples.

Using that task automatically pushes the specified binaries to the location you specify (either a UNC share, or within the TFS instance itself). It then creates an Artifact link against the build result, so when you queue a release of the build, the release can automatically retrieve the artifacts associated with the build.

1
votes

You don't need to use extra variables in release to fetch build artifacts. In your Release definition setting, there is a part of Artifact sources. TFS will auto download them to the agent.

You can link a release definition to any of the build definitions in your Team Foundation Server project collection.

enter image description here

By default, a release created from the release definition will use the latest version of the artifacts.

At the time of linking an artifact source to a release definition, you can change this behavior by selecting one of the options to use the latest build from a specific branch by specifying the tags, a specific version, or allow the user to specify the version when the release is created from the definition.

Note: You must include a Publish Artifacts task step in your build definition.

More details, suggest you first go through the official tutorial in MSDN: Artifacts in Release Management