-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Release SHA status information missing #757
Conversation
To answer your first point, it had been my intention to append this to |
This would do it, for now, I got this appended:
|
@@ -42,7 +42,10 @@ namespace :git do | |||
task update: :'git:clone' do | |||
on roles :all do | |||
within repo_path do | |||
get_revision = -> { capture("cd #{repo_path} && git rev-parse --short HEAD") } |
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.
Thanks for this - I think overall I would probably rather see this pushed into a DSL method, maybe capture_revision
? I also suspect that it doesn't need to be a lambda (and I'm not really a fan of the []
syntax 😄 ). Still I'm tempted to merge this as is, it's great to have the SHA in the logs
You're totally right, the lambda is my way of avoiding duplication while conserving locality since I'm not yet familiar with that code. I'm thinking of a 'capturing_revisions' around-like method that yields to the execute. What do you think? |
So, 32920c1 IMHO solves all points:
What I don't like is nested blocks problem, but correct me if I'm wrong this is standard practice with the new Capistrano. Comments welcome. |
Release SHA status information missing
Awesome, thanks 👍 |
@seenmyfate should we cherrypick this commit to 3.1.x branch? |
@kirs after pushing 3.0.1 out this morning, I've merged 3.1.x down into master ready to go - I don't think there are any more PRs ready to go in, but I've left it just in case |
@seenmyfate oh, I didn't noticed that 😯 I was also thinking about adding the |
Is there any way to get back the REVISION file within the root of the current release? Working on an upgrade to Capistrano 3 but we were using that to ensure we pulled the proper file revision from our CDN. |
You can generate it manually on each deploy. |
@@ -43,6 +54,10 @@ def lock(locked_version) | |||
VersionValidator.new(locked_version).verify | |||
end | |||
|
|||
private | |||
def fetch_revision | |||
capture("cd #{repo_path} && git rev-parse --short HEAD") |
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.
This is going to work only with git backend, right? Any ideas to make it universal with any backend?
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, if you like, let's open an issue and make this defer to the new SCM stuff that we got in #828 ?
@kirs - any tips on how to do that? I'm really struggling with the upgrade to cap 3, there don't seem to be a lot of tutorials out there and the documentation is a bit sparse after the installation and setup instructions. Are there example tasks out there somewhere to look at? Edit: if anyone else is looking to do this, here's the task I ended up making that gets the release timestamp and puts it in a REVISION file. Wasn't sure how to get the full hash (fetch_revision appears to give the last few characters only) but this is all I need for my purposes.
And I found EXAMPLES.md inside the sshkit documentation which was helpful as well. |
This currently does not support branches (and only git of course :)). |
This has been removed from Capistrano 3, and there's currently no way that I can figure out to accomplish the following:
REVISION
file on the root of every release that you could just read. Not anymore.Your thoughts on this?