TFS 2015 Gated Build is creating a Build and Triggering Release Job - tfs

We are working on TFS 2015 Update 1
The same Job is triggering CI / Gated / Scheduled Build
I want CI/Scheduled build to Publish Artifact
Unable to find a way to disable Build Step Dynamically
I am calling a Powershell Script before 'Publish Build Artifact' Step and trying to find a solution to access the next Step and Set it to 'Skip'
But I have seen even when the Drop folder is empty, the Release (CI/CD) triggers as the Gated Job is creating a Build
Is there a way to avoid Gated Job to create a Build
or to avoid Release Job to trigger in case of Gated Build

In TFS 2015 update 1 I think you're way too far behind. There are solutions for later versions. In your case, you'd need a separate Build Definition for the gated build and if my memory serves me right, you don't have the task group option yet. Task Groups were introduced in TFS 2017, they would at least allow you to share process and variables between separate build definitions.
You're on an unsupported TFS version, in any case, TFS 2015 update 1 was replaced by TFS 2015 update 3.1 any versions between TFS 2015.0 and 2015.3.1 are unsupported and TFS 2015 update 1 contains a number of XSS security vulnerabilities that were fixed in TFS 2015.3.1 as well as in TFS 2017.0.1, 2017.3.1 and 2018.1. This would be a good time to upgrade and make the jump.
In TFS 2018 this would be possible with an artefact tag filter:
Prevent Release Trigger on Gated Check-in build
One option that remains available is to turn off the CI trigger of the release workflow and then from a powershell script, conditionally trigger the release from the build.

Related

TFS 2013 Multipipeline builds like in Jenkins

I have been looking for a while now. Is there any way to create something like multipipeline branches from jenkins in TFS 2013?
Multipipeline builds in Jenkins work such that everytime a developer creates a branch in the repository, Jenkins would clone the main build and create a new build specifically for that new branch. Once the branch is deleted, the build also disappears. This way we can make sure that nothing is merged back to master, that did not pass tests or doesn't build.
Is there any way to achieve the same effect in TFS 2013? I know its possible in Azure DevOps but can't find anything specifically on TFS 2013. Sadly TFS2013 is a constraint of the project and cannot be changed.
Is there any way to achieve the same effect in TFS 2013?
I am afraid there is no same workflow in TFS2013, TFS newer versions(e.g. 2015 2017 2018...),Azure Devops Service.
Since TFS2013 is an older version, many features are not supported in this version of TFS.
For example: Triggers, Conditions and so on.
So even a similar workflow cannot be used in TFS2013. I suggest you can update TFS2013 to a newer version, so you will have more applicable functions
In the newer version of TFS, Azure Devops Server or Azure Devops Service, it can use triggers and conditions to trigger build or task to verify the branch.
For example:
You could set CI Trigger for pipeline, and set condition for some tasks. Then when the new branch is created, it will trigger the build. In the build, it will determine the task to run based on the triggered branch(condition).
Or in order to avoid directly merging the branch into the master, you can use PR trigger to pre-merge the branch so that you can verify that the branch is correct.
For more detailed information, you could refer to this doc: Build multiple branches

Continuous Integration build over TFS2017

I would like to know what is the equivalent of "Continuous Integration - build each check-in" (XAML definition) in VNext definitions.
1- Is it "Run continuous integration triggers for commited changes" in Gated trigger?
2-Or it is a "Continuous Integration trigger with batch changes checked" in build definition.
I ask this question because I was not able to launch a CI build after successfully Gated Check-in. My CI build does different steps than Gated.
I'm over TFS 2017 (15.117.27414.0).
The equivalent of "Continuous Integration - build each check-in" (XAML definition) in VNext definitions is Continuous Integration trigger:
Enable CI trigger if you want the build to run whenever someone checks
in code.
Select Batch changes check box if you have a lot of team members
uploading changes often and you want to reduce the number of builds
you are running. If you select this option, when a build is running,
the system waits until the build is completed and then queues another
build of all changes that have not yet been built.
Select the version control paths you want to include and exclude. In
most cases, you should make sure that these filters are consistent
with your TFVC mappings on the Repository tab.
You can get more details in the link below:
https://learn.microsoft.com/en-us/vsts/build-release/concepts/definitions/build/triggers?view=vsts

Personal builds (pre-test commits) using TFS and Jenkins

Is it possible to trigger personal builds using TFS and Jenkins? Similar to what can be achieved using Teamcity. Can a developer trigger a build without checking-in so that his/her changes can be tested before checkin?
thanks,
You can do this with TFS. Assuming you are using TFS Build, available in TFS 2015 and in VSTS, and your source control is Git, you can setup a build policy for a specific branch that triggers a build any time a pull request happens. Details here.
If you are using the older XAML builds, look at Gated Checkins.

On Premise Gated Check-in Fails with "The shelveset ... could not be found for check-in"

I am having an issue with the new TFS 2015 Update 2 Gated Builds.
After attempting a check-in the gated build queues just fine, every part of the build is successful until it reaches the last step of "Check in gated changes".
When I look at the log for that step I get:
[Error]The shelveset _Build_5427;Build\ad8fe058-f936-4908-91de-57e7bc6a2f9d could not be found for check-in
When I look at the 'Get Sources' log, I see:
2016-04-01T19:11:12.3062092Z tf get /version:C6213
2016-04-01T19:11:13.2125013Z tf shelve _Build_5427 /replace
2016-04-01T19:11:13.3218610Z Successfully created new shelveset _Build_5427;Domain\BuildServiceUser
I recognize the username as the service user (and have thus redacted it here). It looks like it is trying to find the correct shelveset name, but for the wrong user.
Update 4/20/2016 :
I ended up having to create a brand new project.
The failed reason: your are trying to check in files with your own account. But the build agent try to check in the changes with the service account.
It seems there are something wrong with your build agent. After you update your TFS server to TFS update2, you also need to update your build agent. If still not work , try to download the agent and deploy a new one. Detail steps from MSDN: Deploy a Windows build agent
I experienced this issue using on-premise TFS 2015 Update 2. As a workaround I settled with a regular CI-build instead of the Gated trigger and I scheduled a release buiild nightly.
However, we have recently installed TFS 2015 Update 3 and that solved the issue. We now use the configuration that we wanted: 1 Gated build that checks in the changes and 1 Continuous Integration build for the release.

TFS Build queue issue

I have one build controller and it has 4 build agents in it. When I run more than one build at a time it queues the build. Why it doesn't run 4 builds parallel? Is there any settings that I should change?
I am running TFS 2012.
running gated checkin
it also runs all the tests after the build is done.
Thanks for the help!
This is 'by design'. From Use a gated check-in build process to validate changes
Each gated check-in build definition can have only one running build at a time.
This is necessary to preserve the logic coherence of you version control.
If this is slowing your dev organization, you have many options (some are in the doc linked):
Change from Gated to Batched gated
Have multiple Build definitions (mapped on different portions of you sources)
Minimize the checks during build
Feed more resources to the Build server

Resources