-
Notifications
You must be signed in to change notification settings - Fork 492
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
Git commit is lost after checkout #308
Comments
Since that file would need to be unique for each release, it should probably live in the release directory, but using a safer name like I think that messing with the release directory is a bad idea, but I don't see any other way of getting that done, unless mina is able to expose global shell variables that can be used within queued commands, is there anything like that in mina? That seems to be a good feature to have generally. |
Sorry for my verbiage, but thinking more about the shell variable, that wouldn't work if I wanted to access the revision hash after a deploy, using Another solution to avoid writing to the release directory would be to have another deploy top-level directory that contains versions-to-revisions information, for example, write the revision to a file |
does PR #306 solve your problem? |
👍 |
I'd want to tag my app with the current git commit being built (not git tagging, but compile a binary setting a field with the commit hash), but this info is lost after
git:clone
. I thought of saving the commit myself but beforegit:clone
that's not available, and after that it's already lost.Using the local repository to get that information is probably the worst solution, since there may be pending commits hanging there, so I'm not even considering this as a workaround.
A workaround is to use
commit
directly if given, otherwise usegit --git-dir=<deploy_to/scm> show-ref -s <branch>
, but I think that's not an elegant solution.I think a good solution would be to have
git:clone
savegit show-ref -s HEAD
to aREVISION
file after checkout (either viacommit
orbranch
) but beforerm
'ing the local git bare repository (exactly before the "Using this git commit" message).Besides tagging, another good use case I'd like for myself is to document which commit was used in which version. This way I can debug properly. Another use case would be to use in notifications or logging deployments with timestamp, revision, etc.
The text was updated successfully, but these errors were encountered: