TFS - Multiple builds feeding a single release - tfs

I have 2 builds (A & B), which create their own artifacts which are dropped into the $(Build.ArtifactStagingDirectory) and then published to 'Visual Studio Team Services/TFS'
Everything works fine for build A, but I am finding that when I am wanting to download an artifact from build B, that artifact cannot be found. When I look at the error message, I can see that TFS is actually looking for it from build A.
I dont want to point to a specific build number for build B, instead just want to point to the latest build of B.
Anyone know how I can update the reference so that TFS is looking at build B?
If I use the 'Download Artifact' Task, I can get this to work if I point to a 'Specific Build', but it does not work if I use the option 'Current Build'

Try below steps to achieve that:
Create 2 build definitions to queue Build A and B :
Build Definition A -- Build A
Build Definition B -- Build B
Create a release definition, add Build Definition A and Build Definition B as the artifacts source.
Trigger the release
Release works with multiple artifacts:
UPDATE1:
The Download Artifact task only works on single artifact, multiple artifacts doesn't work.
Besides, why you have to use the Download Artifact task? By default the release definition has enabled the Download Artifact, that means it will download the multiple artifacts automatically, then you just need to use the multiple artifacts directly in other tasks.
UPDATE2:
Since you already linked multiple artifacts in your release definition, that means you have to download them to use on subsequent Phases/tasks. But based on your description seems you want to use the Download Artifact task to down the latest version of one of them. That seems a bit contradictory for your requirements.
I can think of is that you can download the artifacts to a staging folder, then add copy task to copy the artifacts which you need in your phases.
Besides if you want to download all the latest artifacts, you can try this extension: Download Artifacts

Related

Jenkins copy artifacts from another project

I moved a job that does an update function from one project to another. Under the configure option i used the copy artifacts from another project and updated the tab with the project name from which project it needs to pull files from and hit save. When i run build on the job, it does not pull the files that it needs to from the intended project and the build fails. Am i missing anything on this?

Can I control any options for 'Get Sources' on a TFS build?

I have three builds.
Build A
Build B (cloned from A)
Build C (cloned from B)
Build A builds our entire environment, Builds B and C were cloned, but then stripped to only build specific parts and from different branches. Since doing this, we've seen the build time on Build A triple. It is running tf vc workspace /delete on every build.
Build C also deletes it's workspace, but build B does NOT. On the repository tab, all three have Clean set to false.
Is there anywhere to view/set options for the Get Sources task? What would cause one build not to do this and the other two to do it?
There are only three TFVC options in get source step of TFS build pipeline.
No any other extra option to control the get source task.
First suggest you check whether you set Clean = true in Visual Studio Build task, you need to uncheck it here.
If you do not check Clean option and the build always refreshed workspace on local build server and build agent always cleans TFVC Repository. Try this solution: completely wipe the agent directory and start again, this may fix the problem. Another way is reconfigure your build agent and trigger the build again.
Besides, you could also disable the default get source steps in the build definition. And use your own script to do the get source/pull files to bypass workspace mapping issue. How to, please follow: Is it able to ignore/disable the first step Get source in vNext Build?
I found my answer. By adding the System.debug = true I was able to get a view of the actual mappings in the workspace. Then I matched that up against a list of all the mappings in the repository of the build. What I found was that when we map a folder and one of its sub-folders as well, only the parent folder mapping is created in the workspace definition.
When Get Sources runs, it looks for a workspace name that matches and then first does a simple count check. When the number of mappings in the repository doesn't match the number of mappings in the workspace it fails out and immediately deletes and rebuilds the workspace.
By removing the sub-folder mappings, my Get Sources task dropped from 11+ minutes to seconds.

How to keep artifacts directory during the multi-configuration build in TFS?

I have a solution with multiple projects where some are web apps. I have set up a multi-configuration build in TFS vNext that builds the single app, creates an MSDeploy package, gets the proper staging configuration files and add or replaces the files in the package archive file.
I'd like to use the deployment files created as artifacts to be used in a Release Management pipeline. The problem is that the artifacts directory is purged before each build (i.e. build of a web application). At the end, only the artefacts of the last app that was built are left there.
I can certainly configure the step to copy the artifacts somewhere else, but then the question is how to delete it only at the very start of the build (and by that I mean the build of all projects).
Is there a way how to disable purging of the artefacts directory or how to perform an operation only at the beginning of the build? Has anyone similar experience?
Use the "Publish Artifacts" task to store the artifacts in a UNC location or in TFS itself so they're available for release.

How to enable Artifacts link

I have a TFS2015 build definition: after the build step I have a PowerShell step which is publishing the build artifacts.
How can I enabled the Artifacts link in the build summary?
I've noticed that the Artifacts link is visible only when I have a Publish Artifacts build step in the build definition. I can't use this step because I need a specific folders structure in the build drop folder.
The easiest thing might be to use your PowerShell script to prepare your drop as normal but then add the Publish Build Artifacts task so that the artifacts tab of the release is populated.
The example in this article uses $(build.stagingDirectory) to order the files and then specifies that directory in the Copy Root field of the Publish task.
http://www.codewrecks.com/blog/index.php/2015/06/30/manage-artifacts-with-tfs-build-vnext/

Jenkins Node/Slave(Mac iOS build) - how to get the build package

I have setup Jenkins and everything is fine. It is connected(JNLP) and builds fine.
But how can I get the build back onto the master(the server hosting Jenkins)?
One thing could be to activate a script on the slave/node to copy the build. But since we have this very nice connected JNLP, my first thought was to get it through this connection?
Thanks in advance
Regards
christian
Usually, you'd use the artifacts mechanism to save off the results of the build (the .app for example) and then in another script to retrieve them and take the next step and Jenkins takes care of storing them for you.
To save them off, add a post-build action to Archive the artifacts and then give the path of the artifacts you want to save (optionally excluding some elements, etc).
When I store artifacts for iPhone builds, I usually store the -dSYM.zip and .ipa files.
If you want to use them in another build step, you can then use the Copy Artifact Plugin to copy them as a pre-build step and then operate on them later (for example: if you want to manually release the .ipa and dSYM.zip files to TestFlightApp or HockeyApp or another distribution mechanism).

Resources