Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,553,305
Community Members
 
Community Events
184
Community Groups

Cleaning up build-dir on remote agents

I've noticed that my build-dir on my remote agents is getting quite large. When i started digging around in there I saw directories related to plans that haven't existed in quite some time.

I'm wondering two things.

First, is there a way in bamboo to have the remote agents clean up their build-dir after a certain amount of time. I know about the build exipry settings, but that's both wonky and is just related to build results. I want to clean up the actual directory the code is checked out to and built.

The second is, why do the build dirs for removed plans exist? Shouldn't the server send signals out to the agents to remove that stuff?

Thanks

5 answers

2 accepted

2 votes
Answer accepted

Actually, I found exactly what i was looking for.

https://confluence.atlassian.com/display/BAMBOO/Deleting+a+job%27s+current+working+files

Configure plan->jobs->misc-> make sure "Clean working directory after each build" is checked.

The problem with that setting is that if/when a build fails, you have nothing to look at to determine or troubleshoot the cause of failure.

Like Matthew Pass likes this
0 votes
Answer accepted

For people who still look for a way to clean build directory before the build not after, there is a task "Clean working directory" that you can add as first task to your job. Artifact download will happen after this task.

Job>Add task> Clean working directory

1 vote
EddieW
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Aug 08, 2014

Teams with larger farms and round-the-clock builds can use Monit and Agent APIs for Bamboo to monitor the disk space of agents and react as needed.

The plugin allows you to disable the agent, and monitor it until running builds finish. Monit acts as the monitoring tool that kicks off the task to cleanup.

Monit control file, and cleanup shell script example

Link to the Monit example is dead. It looks like exactly what I need - can you show us the new location?

1 vote
Jason Monsorno
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Aug 26, 2013

I haven't included this one in particular but I already have a bamboo plan that runs every night to do certain clean up/utility functions, thought I'd keep all the scheduling inside Bamboo while I was at it. I already ask the APIs for quite a few stats, should be easy enough to make it delete directories for any plans/branches that don't exists.

I couldn't find any built-in solution for quite a few things already so I try to make all my work arounds able to run nightly.

That's an interesting approach. I was running this stuff through cron jobs but I like your approach better. It has a nice side effect of making sure the agent that you're deleting from isn't currently trying to build any plans at the same time.

Jason Monsorno
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Aug 26, 2013

We use 15 local agents, so I hadn't thought about that aspect. Personally we clean up after each job but I may switch to just delete that agent's working directory nightly.

So I just saw this: https://answers.atlassian.com/questions/199454/describe-exactly-when-bamboo-workspaces-are-cleaned-removed under the related questions section. It probably would have been nice if that came up before i submitted the question.

At anyrate, it looks like that this functionality isn't supported and I get to add some custom shell scripting glue to make my 'out of the box' solution work. That or buy bigger harddrives.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events