Skip to content
This repository has been archived by the owner on Aug 5, 2020. It is now read-only.

Commit

Permalink
Merge branch 'release-1.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Cory Lown committed Aug 2, 2019
2 parents f138175 + a9a112b commit 080de78
Show file tree
Hide file tree
Showing 13 changed files with 118 additions and 105 deletions.
56 changes: 44 additions & 12 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,71 @@
stages:
- build
- test
- deploy

variables:
RAKE_COMMAND: sudo -u $RAILS_USER -n -i $RAILS_ROOT/bin/rake -f $RAILS_ROOT/Rakefile

build_job:
stage: build
before_script:
- ruby -v
- gem install bundler -v '2.0.1' -N
- sudo -u $RAILS_USER -n -i gem install bundler -v '2.0.1' -N
- bundle version
script:
- cp $RAILS_DEPLOY_PATH/etc/*.yml config/
- bundle install --path=vendor/bundle --binstubs=bin --no-cache --clean
- bundle binstubs bundler --force
- bundle exec rake assets:precompile
artifacts:
paths:
- .bundle/
- bin/
- config/*.yml
- public/assets/
- vendor/bundle/
cache:
key: gems
paths:
- vendor/bundle/ruby
tags:
- antsy

test_job:
stage: test
before_script:
- whoami
- pwd
- env
- source $RAILS_DEPLOY_PATH/etc/export-test.env
- bin/rake db:reset
script:
- $RAILS_DEPLOY_PATH/bin/test.sh
- bin/rake spec
tags:
- development
- antsy

deploy_dev:
environment:
name: development
url: https://find-dev.library.duke.edu
stage: deploy
before_script: &beforedeployscript
- whoami
- pwd
- env
script: &deployscript
- $RAILS_DEPLOY_PATH/bin/deploy.sh $CI_PROJECT_DIR
- rsync -rl --delete --exclude-from=EXCLUDE ./ $RAILS_ROOT/
- '$RAKE_COMMAND db:setup 2>/dev/null || true'
- $RAKE_COMMAND db:migrate tmp:cache:clear
after_script: &afterdeployscript
- $RAILS_DEPLOY_PATH/bin/after_deploy.sh
- sudo /usr/bin/systemctl restart $RAILS_SERVICE_UNIT
only:
- develop
- antsy
tags:
- development
- antsy

deploy_pre:
environment:
name: pre-production
url: https://find-test.library.duke.edu
stage: deploy
before_script: *beforedeployscript
script: *deployscript
after_script: *afterdeployscript
only:
Expand All @@ -47,7 +80,6 @@ deploy_prod:
name: production
url: https://find.library.duke.edu
stage: deploy
before_script: *beforedeployscript
script: *deployscript
after_script: *afterdeployscript
only:
Expand Down
20 changes: 16 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
language: ruby
addons:
postgresql: "10"
apt:
packages:
- postgresql-10
- postgresql-client-10
env:
- RAILS_ENV=test
rvm:
- 2.4.4
before_install: gem install bundler -v 1.16.2
- 2.5
before_install:
- gem install bundler -v 2.0.1
before_script:
- cp config/database.travis.yml config/database.yml
- bundle exec rake db:setup
script:
- bundle exec rubocop
- bundle exec rspec
- bundle exec rubocop
- bundle exec rspec
4 changes: 4 additions & 0 deletions EXCLUDE
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.git/
/config/mappings/
/log/
/tmp/
70 changes: 17 additions & 53 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,77 +7,41 @@ git_source(:github) do |repo_name|
"https://github.com/#{repo_name}.git"
end

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use Puma as the app server
gem 'puma', '~> 3.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'addressable', '~> 2.5'
gem 'better_errors', '2.1.1'
gem 'blacklight', '~> 6.7'
gem 'coffee-rails', '~> 4.2'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes navigating your web application faster.
# Read more: https://github.com/turbolinks/turbolinks
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'devise'
gem 'devise-guests', '~> 0.6'
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

gem 'jquery-rails'
gem 'lcsort', '~> 0.9'
gem 'non-stupid-digest-assets'
gem 'pg'
gem 'puma', '~> 3.0'
gem 'rails', '~> 5.0.1'
gem 'sass-rails', '~> 5.0'
gem 'sprockets', '~> 3.7.2'
gem 'trln_argon', git: 'https://github.com/trln/trln_argon'
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
gem 'uglifier', '>= 1.3.0'
gem 'velocityjs-rails'

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get
# a debugger console
gem 'byebug', platform: :mri
end

group :development do
# Access an IRB console on exception pages or by using <%= console %>
# anywhere in the code.
gem 'listen', '~> 3.0.5'
gem 'web-console', '>= 3.3.0'
# Spring speeds up development by keeping your application running in the
# background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
gem 'web-console', '>= 3.3.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]

gem 'addressable', '~> 2.5'
gem 'blacklight', '~> 6.7'
gem 'lcsort', '~> 0.9'
gem 'trln_argon', git: 'https://github.com/trln/trln_argon'

group :development, :test do
gem 'rails-controller-testing'
gem 'rspec-rails', '~> 3.8'
gem 'rubocop', '~> 0.58.2'
gem 'rubocop-rspec'
gem 'solr_wrapper', '>= 0.3'
end

gem 'devise'
gem 'devise-guests', '~> 0.6'

gem 'better_errors', '2.1.1'

# JS animation library
gem 'velocityjs-rails'

# use static assets for error pages
gem 'non-stupid-digest-assets'
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ GEM
parser (2.5.3.0)
ast (~> 2.4.0)
parslet (1.8.2)
pg (1.1.4)
powerpack (0.1.2)
public_suffix (3.0.3)
puma (3.12.0)
Expand Down Expand Up @@ -295,7 +296,6 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.13)
thor (0.20.3)
thread_safe (0.3.6)
tilt (2.0.9)
Expand Down Expand Up @@ -343,6 +343,7 @@ DEPENDENCIES
lcsort (~> 0.9)
listen (~> 3.0.5)
non-stupid-digest-assets
pg
puma (~> 3.0)
rails (~> 5.0.1)
rails-controller-testing
Expand All @@ -354,7 +355,6 @@ DEPENDENCIES
spring
spring-watcher-listen (~> 2.0.0)
sprockets (~> 3.7.2)
sqlite3
trln_argon!
tzinfo-data
uglifier (>= 1.3.0)
Expand Down
7 changes: 7 additions & 0 deletions app/assets/javascripts/dul-argon-skin.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,15 @@ $(document).ready(function() {
/* Toggle staff view: show barcodes, etc. */
$(".staff-view-toggle").on("click",function(e) {
e.preventDefault();
var show_text = $(this).data('show-text');
var hide_text = $(this).data('hide-text');
$(this).toggleClass('shown');
$(this).closest('.items').find('.barcode-wrapper').fadeToggle();
if ($(this).text() == show_text) {
$(this).text(hide_text);
} else {
$(this).text(show_text);
}
});


Expand Down
15 changes: 12 additions & 3 deletions app/assets/stylesheets/dul_argon/metadata.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,23 @@
}
}

/* Staff view link only on hover */
/* Staff view (barcode) link */
.staff-view-toggle-wrapper {
display: none;
font-size: 12px;
}
&:hover .staff-view-toggle-wrapper {

.staff-view-index {
display: none;
}

&:hover .staff-view-index {
display: block;
}

.staff-view-show {
display: block;
}

}

.location-header {
Expand Down
6 changes: 4 additions & 2 deletions app/views/catalog/_items_section_extra.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<%# NOTE: Overrides trln_argon partial %>
<% if physical_items?(document: document) %>
<div class="staff-view-toggle-wrapper">
<a href="#" class="staff-view-toggle"><%= t('trln_argon.staff_view') %></a>
<div class="staff-view-toggle-wrapper staff-view-<%= action_name %>">
<a href="#" class="staff-view-toggle"
data-show-text="<%= t('trln_argon.show_staff_view') %>"
data-hide-text="<%= t('trln_argon.hide_staff_view') %>"><%= t('trln_argon.show_staff_view') %></a>
</div>
<% end %>

7 changes: 0 additions & 7 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@
module DulArgonSkin
class Application < Rails::Application

config.before_configuration do
env_file = File.join(Rails .root, 'config', 'local_env.yml')
if File.exists?(env_file)
YAML.load_file(env_file).each { |key, value| ENV[key.to_s] = value }
end
end

# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
Expand Down
3 changes: 3 additions & 0 deletions config/database.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test:
adapter: postgresql
url: postgresql://postgres:@127.0.0.1/argon_test
26 changes: 6 additions & 20 deletions config/database.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
adapter: sqlite3
pool: 5
timeout: 5000

development:
<<: *default
database: db/development.sqlite3
adapter: postgresql
url: postgresql://%2Ftmp/argon_dev

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: db/test.sqlite3
adapter: postgresql
url: postgresql://%2Ftmp/argon_test

production:
<<: *default
database: db/production.sqlite3
adapter: postgresql
url: postgresql://%2Ftmp/argon_prod
3 changes: 2 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ en:
error: 'There was a problem finding the location of this item.'
barcode:
label: 'Barcode'
staff_view: "Staff View"
show_staff_view: 'show barcodes'
hide_staff_view: 'hide barcodes'
search:
zero_results:
trln_title_html: 'No results were found at Duke, UNC, NC State, or NCCU Libraries for your search <em>%{search_terms}</em>'
Expand Down
2 changes: 1 addition & 1 deletion lib/dul_argon_skin/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module DulArgonSkin
VERSION = '1.5.0'
VERSION = '1.5.1'
end

0 comments on commit 080de78

Please sign in to comment.