diff --git a/Gemfile b/Gemfile index 3a7d9c8..edab756 100644 --- a/Gemfile +++ b/Gemfile @@ -60,6 +60,7 @@ group :development, :test do gem 'rspec-rails' gem 'selenium-webdriver' gem 'solr_wrapper', '>= 0.3' + gem 'xray-rails' end group :test do diff --git a/Gemfile.lock b/Gemfile.lock index 1f28a5d..fd2cd1d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -812,6 +812,8 @@ GEM xml-simple (1.1.5) xpath (3.0.0) nokogiri (~> 1.8) + xray-rails (0.3.1) + rails (>= 3.1.0) PLATFORMS ruby @@ -852,6 +854,7 @@ DEPENDENCIES tzinfo-data uglifier (>= 1.3.0) web-console (>= 3.3.0) + xray-rails BUNDLED WITH 1.16.1 diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 2f00280..95ef542 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -14,3 +14,7 @@ *= require dataTables/bootstrap/3/jquery.dataTables.bootstrap *= require_self */ + +.site-footer { + height: initial; + } \ No newline at end of file diff --git a/app/views/shared/_footer.html.erb b/app/views/shared/_footer.html.erb new file mode 100644 index 0000000..b03c917 --- /dev/null +++ b/app/views/shared/_footer.html.erb @@ -0,0 +1,20 @@ + diff --git a/config/deploy.rb b/config/deploy.rb index 71e930e..27a27f2 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -21,6 +21,7 @@ append :linked_dirs, "db" append :linked_dirs, "public/assets" append :linked_files, "config/secrets.yml" +append :linked_files, ".env.production" # We have to re-define capistrano-sidekiq's tasks to work with # systemctl in production. Note that you must clear the previously-defined diff --git a/config/initializers/git_sha.rb b/config/initializers/git_sha.rb new file mode 100644 index 0000000..d693855 --- /dev/null +++ b/config/initializers/git_sha.rb @@ -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 \ No newline at end of file