Skip to content

Commit

Permalink
Add DEPLOYED_VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
zw963 committed Jun 20, 2024
1 parent 3a29634 commit 11920ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/actions/version/index.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ class Version::Index < BrowserAction
include Auth::AllowGuests

get "/version" do
plain_text "Deployed version: #{College::VERSION}"
plain_text "Deployed version: #{College::DEPLOYED_VERSION}"
end
end
3 changes: 2 additions & 1 deletion src/app.cr
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module College
VERSION = {{ `git rev-parse --short HEAD`.chomp.stringify }}
VERSION = {{ `shards version "#{__DIR__}"`.chomp.stringify }}
DEPLOYED_VERSION = {{ `git rev-parse --short HEAD`.chomp.stringify + `crystal eval 'puts Time.local.to_s(" %Y/%m/%d %H:%M:%S")'`.chomp.stringify }}
end

require "./shards"
Expand Down

0 comments on commit 11920ac

Please sign in to comment.