-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: master
Are you sure you want to change the base?
Conversation
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
...
No description provided.