0
votes

I am working on a series of builds. There are intermediate files created from few builds and other builds use those files in their build process. The build processes are scripted in PowerShell scripts. We are using private agents as there are custom dependencies.

Currently, we are using a folder on the private agent to store the intermediate outcomes that we refer to in the dependent builds.

We wish to keep it on VSTS (might be as a zip file) and download and unzip to a folder when we build the dependent component.

We see nuget etc. to be not fitting to the requirement.

Is there any available option for it?

2
NuGet would be my recommendation. Why do you see it as "not fitting the requirement"?Daniel Mann
@DanielMann, What we need is to be able to just zip the files in a folder, not as a build output. A PowerShell script and an executable create the files in a folder. Can you still point me to something that I can follow for this?Kangkan
I don't see what that has to do with NuGet. Your build can create a NuGet package and publish it to an internal NuGet feed, then dependent builds can restore packages. There's tons of documentation on the subject that's a quick Google search away.Daniel Mann
Then have you tried with Publish Artifact task? This will upload the files to VSTS and then you can download them in the next build.Eddie Chen - MSFT
@Kangkan You can also publish to a file share path. If you upload to Drop, you can use Download Build Artifact task to download it in another build.Eddie Chen - MSFT

2 Answers

1
votes

If you want to store files in VSTS instead of the local agent machine, you can store the files into a separate repo hosted in VSTS.

Such as to store a zip file ($(Build.SourcesDirectory)\my.zip) into VSTS git repo (https://account.visualstudio.com/project/_git/filestore), you can execute below PowerShell script during build:

git clone https://Personal%20Access%20Token:[email protected]/project/_git/filestore
Copy-Item $(Build.SourcesDirectory)\my.zip $(Build.SourcesDirectory)\filestore
cd filestore
git add .
git commit -m 'add zip file'
git push oirgin master

After executing the build, the zip file my.zip stores in the VSTS git repo.

0
votes

I finally published the outcome from the first build as part of the build artefact and then used in other (dependent) builds. It was nice to do.

Also, found it equivalent to having it on NuGet. Plan to move to Nuget later.