Add version tag

This commit is contained in:
Martin Lensment 2015-01-19 13:15:30 +02:00
parent 537326df1f
commit 254f1993ac
4 changed files with 20 additions and 0 deletions

View file

@ -16,3 +16,9 @@
display:block;
font-size:10px;
}
.footer {
color: #777;
padding-top: 15px;
font-size: 10px;
}

View file

@ -62,3 +62,6 @@
.alert{class: type}= flash[:notice] || flash[:alert]
= yield
.footer.text-right
Version
= CURRENT_COMMIT_HASH

View file

@ -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"

View file

@ -0,0 +1 @@
CURRENT_COMMIT_HASH = `git rev-parse --short HEAD`