mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
Add version tag
This commit is contained in:
parent
537326df1f
commit
254f1993ac
4 changed files with 20 additions and 0 deletions
|
@ -16,3 +16,9 @@
|
|||
display:block;
|
||||
font-size:10px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
color: #777;
|
||||
padding-top: 15px;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
|
|
@ -62,3 +62,6 @@
|
|||
.alert{class: type}= flash[:notice] || flash[:alert]
|
||||
= yield
|
||||
|
||||
.footer.text-right
|
||||
Version
|
||||
= CURRENT_COMMIT_HASH
|
||||
|
|
|
@ -38,6 +38,7 @@ end
|
|||
set :shared_paths, [
|
||||
'config/application.yml',
|
||||
'config/database.yml',
|
||||
'config/initializers/current_commit_hash.rb',
|
||||
'log',
|
||||
'public/system',
|
||||
'export/zonefiles'
|
||||
|
@ -93,6 +94,7 @@ task deploy: :environment do
|
|||
# Put things that will set up an empty directory into a fully set-up
|
||||
# instance of your project.
|
||||
invoke :'git:clone'
|
||||
invoke :load_commit_hash
|
||||
invoke :'deploy:link_shared_paths'
|
||||
invoke :'bundle:install'
|
||||
invoke :'rails:db_migrate'
|
||||
|
@ -118,6 +120,14 @@ task rollback: :environment do
|
|||
end
|
||||
end
|
||||
|
||||
desc 'Loads current commit hash'
|
||||
task load_commit_hash: :environment do
|
||||
queue! %(
|
||||
echo "CURRENT_COMMIT_HASH = '$(git --git-dir #{deploy_to}/scm rev-parse --short HEAD)'" > \
|
||||
#{deploy_to}/shared/config/initializers/current_commit_hash.rb
|
||||
)
|
||||
end
|
||||
|
||||
desc 'Restart Passenger application'
|
||||
task restart: :environment do
|
||||
queue "mkdir -p #{deploy_to}/current/tmp; touch #{deploy_to}/current/tmp/restart.txt"
|
||||
|
|
1
config/initializers/current_commit_hash.rb
Normal file
1
config/initializers/current_commit_hash.rb
Normal file
|
@ -0,0 +1 @@
|
|||
CURRENT_COMMIT_HASH = `git rev-parse --short HEAD`
|
Loading…
Add table
Add a link
Reference in a new issue