-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from RepoCamp/version_footer_magic
Version footer magic 🎩
- Loading branch information
Showing
6 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<footer class="navbar navbar-inverse site-footer"> | ||
<div class="container-fluid"> | ||
<div class="navbar-text text-left"> | ||
<p><%= t('hyrax.footer.service_html') %></p> | ||
<p><%= t('hyrax.product_name') %> v<%= Hyrax::VERSION %></p> | ||
</div> | ||
<div class="navbar-right"> | ||
<div class="navbar-text text-right"> | ||
<p><%= t('hyrax.footer.copyright_html') %></p> | ||
<p><%= t('hyrax.background_attribution_html') %></p> | ||
<br>TEAM2 Version | ||
<br>ENV: <%= Rails.env %> | ||
<br>SHA: <%= link_to(GIT_SHA, "https://github.com/RepoCamp/ascteam2/commit/#{GIT_SHA}") %> | ||
<br>Branch: <%= BRANCH %> | ||
<br>Updated: <%= LAST_DEPLOYED %> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
</footer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
revisions_logfile = "/opt/#{ENV['PROJECT_NAME']}/revisions.log" | ||
GIT_SHA = | ||
if Rails.env.production? && File.exist?(revisions_logfile) | ||
`tail -1 #{revisions_logfile}`.chomp.split(" ")[3].gsub(/\)$/, '') | ||
elsif Rails.env.development? || Rails.env.test? | ||
`git rev-parse HEAD`.chomp | ||
else | ||
"Unknown SHA" | ||
end | ||
|
||
BRANCH = | ||
if Rails.env.production? && File.exist?(revisions_logfile) | ||
`tail -1 #{revisions_logfile}`.chomp.split(" ")[1] | ||
elsif Rails.env.development? || Rails.env.test? | ||
`git rev-parse --abbrev-ref HEAD`.chomp | ||
else | ||
"Unknown branch" | ||
end | ||
|
||
LAST_DEPLOYED = | ||
if Rails.env.production? && File.exist?(revisions_logfile) | ||
deployed = `tail -1 #{revisions_logfile}`.chomp.split(" ")[7] | ||
Date.parse(deployed).strftime("%d %B %Y") | ||
else | ||
"Not in deployed environment" | ||
end |