How to remove old builds in jenkins? [duplicate] - jenkins

This question already has answers here:
Jenkins: remove old builds with command line
(12 answers)
Closed 7 years ago.
I removed old build folders from the build directory in Jenkins expecting them to be removed in the UI, unfortunately whilse these build directories are gone, their UI link still exists. I now have two questions:
How can I get rid of the defunct links in the UI?
How can I delete old build from cli and have it reflected in the UI?

A better way to remove old builds is discard-old-build plugin where you can specify how many builds you want to keep and all older builds are discarded.

You must either restart Jenkins or reload the data, in order to reconcile the UI with its back end. There is no other way.
If you have access to the "Manage Jenkins" menu there is a link to "Reload Configuration from Disk", which is a little less invasive than a restart.
Keep in mind that the system will be not usable for a few seconds while the data is reloaded, just like during a full restart. If you have a lot of builds, this might take a little. So, make sure that this is ok with the other users of your system.

Related

Jenkins “Keep this build forever” button is missing

I am an admin on our Jenkins master but, this button is not available for any builds for any user.
I found this question which has a somewhat relevant answer since we are also using Matrix-based security, however no one has this button showing up on any build
Is there a plugin required to have this feature available?
My version isJenkins ver. 2.105
Keep forever option appears only when relevant, meaning only if you opt in on other option Discard old builds. If not it's irrelevant see jenkins users answer
option only appears if you have chosen to Discard Builds
from the config for the job. (i.e. if you have chosen not to discard
any builds have a certain time/build number, then the button won't
show).

TFS Power Tools: Shell Extension : Context Menu Quirky and TFS Icons on Files/Folders missing

I've used TFS Power Tools on a daily basis for several months. I particularly depend on Windows Shell Extension.
For about a week now, two issues have come up:
Issue 1
Every time I enter a directory under TFS control, I have to right-click twice to see the TFS context menu
Issue 2
My pretty TFS Green indicators on files/folders are gone:
I've downloaded and reinstalled the Power Tools, but I still have these two issues.
Any thoughts on how to fix this?
**UPDATE**
Dave gave me the answer via link. Just in case that link goes bad, here is the answer:
Open the registry
Go to : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer \ShellIconOverlayIdentifiers
Prefix any "Tfs" folder with numbers (“1TfsOverlayAdd” , “2TfsOverlayEdit” etc.). This allows them to take priority over other icon overlays.
Restart the machine or kill explorer.exe and restart it
As far as the delay issue is concerned, I'm not experiencing that this morning; which is odd. I question that the solution for the overlay was also the solution for the right-clicking.
Everything's back to normal now so I am good to go.
The missing green icons can be explained here. It is because Windows has a limit of overlay icons it supports. The details on how to fix it are in that blog post.
How long are you waiting after entering a folder before you perform the first Right Click? It sometimes takes a while for the TfsComProviderSvr.exe to check if the local folder is a workspace and register the shell extension.

How can I make a desktop build in TFS 2010?

I know that the short answer is "you can't". Desktop builds are no longer a part of TFS 2010.
However, I figure that I can somehow, if I install a build agent on my machine, and direct the WF to not get the latest version or a shelveset, and use the existing workspace, I should be able to fake it.
The problem is that between the theory and practice is a large gap in my knowledge. Can anyone think of a way this could work?
What is it, exactly, that you're trying to accomplish? Why not just setup a build agent on your machine and configure an incremental build to run on it? You could pass shelvesets into it via the Queue Build dialog or use a separate branch to keep your sources separate from the rest of your teams.
I finally came up with a solution:
A client that wants to build locally (i.e. desktop-builds) needs to install a Build Controller and Build Agent on his desktop machine. Then he needs to pick that controller for the build.
In the build template, the Get activity needs to be deleted, and the Create Workspace activity needs to be replaced with a Get Workspace, to use an existing one.
Finally, remove the command to copy to a drop folder. You're building locally. Not necessary.
Assaf

What causes TFS to create additional workspaces?

I've seen the question related to the error message you get from TFS when a workspace is already mapped. The accepted answer for removing the workspace is alright as a workaround, but it's already getting tedious to run a delete command each time this error occurs.
What do I need to change in order to get out of having to use this workaround? I've got two builds (continuous integration and nightly deploy), and need to add at least one more build type. I followed this URL to see if there was a possible resolution there, but I'm not sure I understand it completely.
I am not sure how this is accomplished in TFS 2010, as I have not gotten to work with Team Build in 2010, yet. In 2008, though, if you expand the Builds node in the Team Project and right-right click on either of the builds, you will see a "Manage Build Agents..." option. Click into that, and it will bring up a dialog. One of the things on that dialog is an option called "Working Directory". Do you have the same hard-coded path in both of them?
By default, when you create a new build definition, it provides a calculated folder for this value. This is where the build agent will do the checkout from TFS for the build attempt. The default value is, $(Temp)\$(BuildDefinitionPath), I believe (I am not connected to TFS at the moment).
The article you link to is basically saying that you should include either that $(BuildDefinitionPath) value or the $(BuildDefinitionID) value as part of that path in that dialog so that the two builds do not try to use the same workspace. Changing the working folder to include one of those values should resolve your issue, going forward.

Command line argument to Delete all the TFS builds?

I'm using the Build Explorer to delete our project's builds. It's taking forever because it's 'timing out' trying to delete the label and drop location (now that the drop location doesn't exist any more).
So, I'm hoping to do this via the command line to see if I get more love.
Is this possible?
Yes it is, see the following HowTo on MSDN.
How to: Delete a Completed Build (Command-Line)
However, I'm not sure that this is going to improve the situation for you as it basically does the same server calls that the UI does. Give it a try anyway. In the meantime I'll go ask a few folks and I'll edit this answer if we come up with anything to help you with your timeout issues.
The TFS Build Manager utility will let you multi-select and delete. It still works serially but at least it's only one manual step.

Resources