mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +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;
|
display:block;
|
||||||
font-size:10px;
|
font-size:10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
color: #777;
|
||||||
|
padding-top: 15px;
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
|
|
@ -62,3 +62,6 @@
|
||||||
.alert{class: type}= flash[:notice] || flash[:alert]
|
.alert{class: type}= flash[:notice] || flash[:alert]
|
||||||
= yield
|
= yield
|
||||||
|
|
||||||
|
.footer.text-right
|
||||||
|
Version
|
||||||
|
= CURRENT_COMMIT_HASH
|
||||||
|
|
|
@ -38,6 +38,7 @@ end
|
||||||
set :shared_paths, [
|
set :shared_paths, [
|
||||||
'config/application.yml',
|
'config/application.yml',
|
||||||
'config/database.yml',
|
'config/database.yml',
|
||||||
|
'config/initializers/current_commit_hash.rb',
|
||||||
'log',
|
'log',
|
||||||
'public/system',
|
'public/system',
|
||||||
'export/zonefiles'
|
'export/zonefiles'
|
||||||
|
@ -93,6 +94,7 @@ task deploy: :environment do
|
||||||
# Put things that will set up an empty directory into a fully set-up
|
# Put things that will set up an empty directory into a fully set-up
|
||||||
# instance of your project.
|
# instance of your project.
|
||||||
invoke :'git:clone'
|
invoke :'git:clone'
|
||||||
|
invoke :load_commit_hash
|
||||||
invoke :'deploy:link_shared_paths'
|
invoke :'deploy:link_shared_paths'
|
||||||
invoke :'bundle:install'
|
invoke :'bundle:install'
|
||||||
invoke :'rails:db_migrate'
|
invoke :'rails:db_migrate'
|
||||||
|
@ -118,6 +120,14 @@ task rollback: :environment do
|
||||||
end
|
end
|
||||||
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'
|
desc 'Restart Passenger application'
|
||||||
task restart: :environment do
|
task restart: :environment do
|
||||||
queue "mkdir -p #{deploy_to}/current/tmp; touch #{deploy_to}/current/tmp/restart.txt"
|
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