0
votes

I would like to make a release pipeline that works (makes a release package) on the codebase that has been tested by a build pipeline.

How can I make a release that accesses the Git code-base that a specific build pipeline has been successfully completed from?

Notes:

  • Making the release package is time consuming, so I don't want to include that into the build if possible. Making the release package in my case requires the source files (nearly all).
  • I could solve this by copying the entire Git repository to the build artifacts of the build and then use a build artifact, but I don't like this as it requires putting the entire codebase to the artifacts.
  • I was also trying to specify two artifacts for the release: a build and a git one, but I could not figure out how to synchronize the two (the git should use the commit used by the build). For the Git one I can select "a specific commit", but I could not figure out how to specify the commit of the build artifact there.
1

1 Answers

1
votes

If you specify two artifacts for the release: a build and a git one. You can use the predefined release variable Release.Artifacts.{alias}.SourceVersion to synchronize the commit used by the build and the commit of the git artifacts.

This variable Release.Artifacts.{alias}.SourceVersion returns the commit hash from which the build artifact is built. So you can add a script task in your release pipeline to checkout the specific commit. See below example scripts in the powershell task:

cd  _theGitArtifactsAliasName
git checkout $(Release.Artifacts._TheBuildArtifactsAliasName.SourceVersion)

Then the artifacts of the git will be on the commit of the build artifacts.

enter image description here