-
Notifications
You must be signed in to change notification settings - Fork 384
Add current Git commit hash to view #125
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
Conversation
@@ -1,4 +1,9 @@ | |||
<h2>Using React + Redux + Rails Backend (using the react_on_rails gem)</h2> | |||
<p>current Git commit: | |||
<span id="current-git-commit-sha"> | |||
<%= @git_commit_sha %> |
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.
Let's make this clickable to go to the commit.
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.
@justin808 Good idea! I think I will also change it to use the shorter version.
- refactor GitCommitSha class according to suggestions by @justin808 - access GitCommitSha directly from pages_helper instead of going through controller - display shorter version of the hash - make the hash link to the corresponding commit on GitHub
|
||
# Run migrations always just in case | ||
heroku run rake db:migrate --remote $app | ||
heroku restart --remote $app |
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.
@dylangrafmyre Could you please help with implementing this deploy script somehow?
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.
@robwise @justin808 I really don't think we should be using this. Better just better to setup CI to deploy after build passes. Need to eliminate as may manual steps as possible.
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.
@dylangrafmyre Is there a way to somehow set the DEPLOYMENT_SHA
environment variable on Heroku to the latest commit on deployment automatically? That's all we're really trying to do.
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.
@dylangrafmyre @justin808 What about instead of the scripts/deploy
approach, we capture the SOURCE_VERSION
environment variable (doc) on Heroku? Justin, from the thread I found where you were looking into this before, it sounds like the variable is only available during the compilation phase of building the app.
Therefore, our code to grab it would need to go in some sort of buildpack. Modifying the buildpack is probably a bad idea, but we can add our own custom buildpack that does ONLY this special thing. Heroku is apparently capable of running multiple buildpacks sequentially for the same build.
Actually, it looks like we are already running multiple buildpacks because of the need for both node and ruby. And this guy's project seems to be doing exactly what I was saying above: https://github.com/sreid/heroku-buildpack-sourceversion
I can make the necessary changes very easily if this is the route we want to go.
Heroku does not provide access to Git via the command line, so the methods that work for the dev and test environments won't work here. Instead, we can utilize an additional buildpack in .buildpacks to write the SOURCE_VERSION environment variable to a file named .source_version in the application root. We cannot reference this environment variable directly from the app because Heroku only makes it available during the compilation phase of the build, hence the need to use a buildpack to write it to a file for later use by the app.
Ready for review! |
Add current Git commit hash to view
LGTM! Great job!! Love the clean code and clean tests! |
No description provided.