How to change multiple build definitions into schedule builds - tfs

we have around 300 TFS CI build definitions and now i want to change it into schedule build. Is it possible to change CI multiple Builds into scheduled.
Its really heck process to change one by one. I want some PowerShell or batch script to run the builds or any tool to change multiple TFS build definitions to schedule builds.
Thanks in advance.

You can use the TFS API to programmatically create and edit build definitions. Here is an example:
http://blog.ehn.nu/2010/04/creating-a-build-definition-using-the-tfs-2010-api/

Have a look at:
https://visualstudiogallery.msdn.microsoft.com/73bf2d8e-aec6-406c-8e7f-1c678e46557f
You should be able to change the trigger for multiple builds at once. I also created a set of powershell extensions to create/edit builds in bulk, but there is no CmdLet for the trigger yet, but have a look if you are interested in extending it (send me a pull request if you do ;)):
https://github.com/sanderaernouts/tfs-build-tools

Related

Jenkins: launch same job with different parameters

I have a job to maven build our project, we now have one job per release version. As the number of releases grows, there are too many jobs and very hard to find the one we need.
I wonder if there is a way to launch the same job with different parameters? The problem is one job only has one workspace, so I'm not sure if it's possible?
Thanks.
Use This build is Parameterized option to build the jobs. Using this you can build the same job for different parameters. You will be asked to enter the parameter before building or you can also give a default parameter and you can have multiple parameters.
It is good the archive the artifacts which you need later.
You can also have the option keep build forever, this will keep the builds permanently Ir-respective of the number of builds to keep.
To use above option you should enable Discard old build option.
You can also link your repository directly to Jenkins which will trigger the job whenever a new commit is made to master or a new tag is created.

Run Jenkins job all the time

I've a Jenkins job I want to keep running all the time. When a build is ending, I want to immediately trigger another build. How can I do that?
Thanks, Omer
There are two different job configurations for that:
Build Triggers -> Build after other projects are built
Add a post-build action Build other projects
In both cases, you can enter your own Project, so it'll be triggered again every time a build is completed. You can also specify if this should be done only while the project is stable.
There is however one (probably more) drawback in this approach, which is that it'll create enormous overview pages, where all build triggers are listed:
So i'd recommend to do something else and for example use the Jenkins API to trigger a new build. There are many ways to do that, one simple example is adding a build step Execute shell and do something like:
curl -X POST http://localhost:8080/job/$JOB_NAME/build
If you have configured the Jenkins URL, you could also use $JOB_URL. You can also add post parameters to trigger a parameterized build.

Triggering a build from another build(conditional) in TFS 2015

I have created two build definition for two different builds in TFS 2015.
Ex - Build1 and Build2
Both the are getting executed without an error.
What I want to perform is, I want to provide an argument in build one
ex=Build2=True or False.
If the argument Build2=True after build definition Build1 successfully executed the build definition Build2 should get triggered.
And if Build2=False the build process should finish after execution of Build1.
I am able to do this in Jenkins by adding the Build2 to pipeline in postbuild tasks, since I am new in TFS 2015 so can anybody help me to accomplish this in TFS 2015
As #Yan Sklyarenko mentioned, this feature is not supported right now, please vote the User Voice at website below:
https://visualstudio.uservoice.com/forums/330519-team-services/suggestions/2165043-provide-build-configuration-dependencies-in-tfs-bu
I created a Build Task that should allow to support your described scenario. It uses the TFS REST API to queue new builds and supports conditions, for example a check if the last build of a specified build definition was successful or not.
You can download it from the Marketplace
Another option is to create Task Group for each build.
you can read about Task Groups here
and create one build that use some task group in his steps.

Is it possible to run a script when a build is tagged in Teamcity?

We are using TeamCity 9.x as are main CI server. I'm looking for ways to run a script (PowerShell, Python, ...) when a build is tagged. Is this possible?
The only thing I can think of is to write a simple service which polls the REST API for the last x builds and reads the <tag/> information.
We are using TFS for source control, so labeling the sources is not an option (because a label is unique in TFS).
Are there any other (simpler) ways to do this? Or is there any other way to define build quality and execute something?
Yes you can
In the build trigger definition, you can mention specific subset of tags(using regex patterns) on which teamcity targets are trigeered. In your case, you have to set the triggers to run on tags only
I know this doesn't answer your question but figured I'd mention it anyways since you have TFS in your environment already.
If you were using TFS Build it has a drop down on each build to indicate quality. And there's a free tool called TFS Deployer that allows you to run scripts when the quality is changed.

How to perform the Build in TFS2010? What is the Logic should we adopt and How to get a files from TFS 2010?

Currently we are using StarTeam to perform the build as well as versioning. we planned to migrate startteam to TFS2010. We have some script for perform the build. i wanted to change this script according to my requirement. i gone through the TFS but i had lot more confusion.
in StarTeam, we will get a files from "Ready to Build" label and perform the build. In TFS, how we are going to get a files from TFS? What concept should i use to get a files and perform the build? i have gone through the lot of commands like get, check-in, checkout etc..
If we use "tf get" command, we can get all the files from TFS but i have a clarification on that. shall i get all the files from TFS for every build? i hope, this is unnecessary headache.. correct me if i am wrong..
how we perform the build in TFS? i have read some types of build such as manual, gatedcheckin, Continuous Integration and schedule.
Is there any relationship between branch and build activities?
In TFS, What is the meaning of Workspace?
As said, many questions in one. Hope this helps along the way:
A workspace is a mapping between the server and a local storage,
similar to checkout in Subversion, view in ClearCase, etc.
"TF get" normally only fetches those files that have changed since
last update. You can force it to fetch everything - and sometimes
have to - but its not normally done.
Team Build is the recommended system to build with when using TFS. It can take some time to get into (Windows Workflow-based), but is quite powerful. There are default process definitions that set up the most common actions for you.
By default, you can't control whether to build by setting a certain label, but you can define that only this label should be used when builds are triggered. Labels in TFS work a little differently compared to other VCS, though, so maybe there's an 'opportunity' to re-think your build process along the way. If you're set on using a label as before, you'll need to build a Custom build activity.

Resources