Skip to content

Feature/cleanup #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Feature/cleanup #5

wants to merge 13 commits into from

Conversation

benka
Copy link
Contributor

@benka benka commented Sep 29, 2015

No description provided.

@@ -129,8 +129,9 @@ def list_templates
option :config_dir, :type => :string, :default => File.expand_path("~/.cs-builder")
option :log_level, :type => :string, :default => "INFO"
option :stack, :type => :string, :default => "cedar-14"
option :clean_up, :type => :boolean, :default => false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a long_desc and add a md file like the other commands? The docs should explain when it's appropriate to add clean_up, aka it'll slow down the build, which is ok for one-offs.

I was thinking that instead of a clean_up flag here we'd have something like: cs-builder clean-repos --older-than 1.week, that could be run independently - say after a deploy. The goal would be that it'd be a bit more independent from any other task. This would check how old each repo is and if older than the predicate it'll be FileUtils.rm_rf-ed. That said if tthis works for you then it's ok.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 yes, i was thinking about something similar, something that would be an individual cmd rather than an option of a command.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now that we have the clean up command - do we need this anymore?

@@ -0,0 +1,12 @@
`clean-repos` will clean up slugs and repositories older than a spcified number of days
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

get_org_dirs(path_slugs) if @slugs
end

def get_org_dirs(path)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you only really want to find the first git repo on a given path right? Here's a way of doing that: https://gist.github.com/edeustace/464c4ad6b03b3f2934d7

Running locally i get:

 ~/Desktop/find_repos.rb ~/.cs-builder
/home/ed/.cs-builder/repos/corespring/corespring-api/release
/home/ed/.cs-builder/repos/corespring/corespring-api/feature/AC-65-glue-in-v2-editor
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants