Is there a possibility, when I cancel a TFS Build via Web, that an automatic cleanup will be done?
I have the problem, that everytime I cancel a build/release - the "workspace" will not cleaned. So that means only the task will ended.
Thanks in advance!
In the source section of your build make sure you clean every time you build. Please note this will slow down your build time if you have a lot of sources
It seems you use on-premise TFS/DevOps Server, there is no default way to clean workspace when you cancel Build/Release.
You would need to add your own powershell script to clean the workspace in Build/Release Pipeline. An easy way is as #Daniel Mann mentioned, you can clean the workspace in your next build.
Related
I have two different TFS instances. Both use TFVC as a source control.
I want to set up a build definition on TFS1, so that it gets sources from TFS2. Is it possible to do it?
There is no option "Remote TFVC", only "Remove Git".
Thank you.
As far as I can tell, it isn't supported in either TFS On-Prem, or VSTS. Depending on your needs, circumstances and limitations, you might consider one of the following options (all are more or less trade-offs):
Migrate sources from TFS2 to TFS1 (the one to run builds)
This seems to be the correct thing to do, but it is a time-consuming and error-prone process
Fake the Get Sources action and do the real get/checkout in the first build step
You can configure the Get Sources step to address any Git repo in the same team project, and turn the Don't sync sources flag ON. Then, in the first real build step, run command-line Get (something like this)
You may use custom build step (cmd or bat file) and download files from remote server. Examples:
Copy files from tfs versioncontrol to directory with PowerShell
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/9559f7a5-405a-456c-a66b-8123d52ed23a/how-to-copy-a-folder-from-tfs-source-control-to-shared-location-with-powershell-script?forum=tfsgeneral
You could just add the extension to get them from an external vsts/tfs.
Go to the marketplace and search for them (see image).
You will have to configure a endpoint to your external vsts/tfs, but it is quit easy to do.
You can install this extension: TFS artifacts for Release Management.
Then add a Download Artifacts-External TFVC task from Utility.
I have our Solution on CI build. That works.
When dev's check in changes, the solution builds, but only for changes to that solution.
How do I get the build definition to build on changes to OTHER folder changes outside of the solution?
Yes, I can add a workspace in the workspace sources tab. But that means all that code is downloaded on every build.
Our solution has over a dozen dependencies. I would like to trigger a build if any of those dependencies change. We don't need the dependency source code to download into the build workspace at all. That's just pointless.
Yes, we have a folder in TFS for our Nuget Packages. We check them in automatically on build (Thank you TFS).
I could just add the NugetPackage workspace to the solution's workspace list, BUT that would result in every version of every dependency getting downloaded into the build workspace.
How can I trigger a build on a change that I do NOT list in the workspaces list of the build definition?
Btw, we are using TFS 2012
I was hoping the Cloaking feature would allow for this, but if it's cloaked, the automated build does not trigger. The automated build only fires if the workspace folder is set to active. Which also means download every NugetPackage in that same folder!
It's not able to trigger a CI build on a change which not list in the workspaces list of the build definition.
A few other things to know
Make sure the folders you include in your trigger are also included in your mappings on the Repository tab(the same to
workspace mappings).
Source Link
As a workaround you could set clean workspace to false, which will not get other unchanged files every time.
If your build process does not require a clean workspace or
repository, you can significantly reduce the time that is required to
run the build setting this parameter value to False.
We are using TFS 2015. I'd like to create a build and then trigger a release (with RM). We have a webproject and a wpf app. Inside of the code we have compiler directives (#if DEBUG). And the config transformation has to be executed.
My approach was to create a build for Debug and Release, publish it and copy it to a drop folder.
Can anyone tell me what is the best way to achieve this?
Thank you in advance.
If you want to trigger an agent-based release, you can use a custom build task:
https://github.com/incyclesoftware/build-tasks
(Full disclosure: I created these tasks.)
When you deploy a task-based build, make sure the component in Release Management is named the same thing as the artifact you published in the build.
I am new to Jenkins. How to do "incremental build" in Jenkins. I can't find any option in Jenkins for the same.
I want my Hudson build job to build only the components that are changed in SVN.
If it is maven project, you can click the advanced button in build section and enable "Incremental build - only build changed modules"
I also try do this job after the full compile, I find the takari plugin to meet it , but it fail. It always comile all the source code to the target. So i think this could be done by the diff between the newest one and the old one in some place. But not very well tools to find the class or file diff in this situation.
I have made a checkout in my directory of an SVN repository. The project take a lot of time to be completely checked. And so while creating my Hudson job I need this in order :
Clean up the directory (this resolves some ambiguous problems such as : "Hudson workspace locked while building" )
Revert the changes
Update
The choices that I have for Check-out Strategy, in the Hudson job creation form, are:
Use svn update as much as possible, with 'svn revert' before update
Use 'svn switch' as much as possible
Use 'svn update' as much as possible
Clean checkout folders and then checkout
Emulate clean checkout by first deleting unversioned/ignored files, then 'svn update'
Clean workspace and then checkout (Eliminated)
What is the right option for my case?
Thank you a lot!
If your build is done correctly, you should be able to simply do use 'svn update as much as possible. This is the fastest way to update your files. This means not modifying committed files, or placing build artifacts in directories where they will interfere with the build process. In a Java shop, simply keeping all built objects in a subdirectory (we use target to match Maven, but others use build or diet) and out of the way of the rest of the process.
Most people do a clean as part of their build step. This, in theory, should not be necessary, and doing so will lengthen build times. The idea of the build is not to do any unnecessary work. If a source file isn't changed, the corresponding object file should not need to be rebuilt. However, Java is pretty fast at compiling, that most Java projects simply wipe the build directory clean. In C projects, not deleting old objects is better since it really reduces build time.
If there is a problem with your build process where use 'svn update' as much as possible can't work, you should fix your build process. However, there are a couple of projects on our old Jenkins server that do have problems, and they simply aren't updated enough to worry about it. For those, I do Always checkout a fresh copy. This takes the longest, but if you're having problems with your build process, I wouldn't bother using emulate a clean checkout by first deleting unversioned/modified files and use svn revert first. These can cause update conflicts, and cause problems with your build. Either get the build working correctly, or do a clean checkout.
I would go with "Use svn update as much as possible, with 'svn revert' before update". If that is not sufficient, check out the EnvInject Plugin. It can run a script before the SCm checkout happens. You can use it to run a svn cleanup for your job, before the Subversion plugin takes over with the revert and the update. Caveat, you need to install some kind of SVN command line client on your build server.