Skip to content

Commit

Permalink
Merge branch 'main' into i488-cklibrary
Browse files Browse the repository at this point in the history
  • Loading branch information
Twade968 committed Nov 1, 2022
2 parents 63080b6 + 77eae1b commit 8236f08
Show file tree
Hide file tree
Showing 98 changed files with 4,268 additions and 1,622 deletions.
42 changes: 27 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,21 @@ commands:
- run: gem install bundler -v '2.3.11'
- run: cp Gemfile.lock Gemfile.lock.bak
- restore_cache:
keys:
- rails_template-cimg-{{ checksum "Gemfile.lock.bak" }}
keys: &gem_key rails_template-cimg-{{ checksum "Gemfile.lock.bak" }}
- run: bundle install --path ./vendor/bundle
- save_cache:
key: rails_template-cimg-{{ checksum "Gemfile.lock.bak" }}
key: *gem_key
paths:
- ./vendor/bundle
- restore_cache:
name: Restore Yarn Package Cache
key: rails_template-yarn-cimg-{{ checksum "yarn.lock" }}
key: &yarn_key rails_template-yarn-cimg-{{ checksum "yarn.lock" }}
- run:
name: Install NPM Dependencies via Yarn
command: yarn install --frozen-lockfile
- save_cache:
name: Save Yarn Package Cache
key: rails_template-yarn-cimg-{{ checksum "yarn.lock" }}
key: *yarn_key
paths:
- ~/.cache/yarn
orbs:
Expand All @@ -29,18 +28,31 @@ jobs:
build:
working_directory: ~/rails_template
docker:
- image: cimg/ruby:3.0.3-browsers
- &ruby_docker
image: cimg/ruby:3.0.3-browsers
environment:
RAILS_ENV: test
steps:
- checkout
- run: sudo apt update && sudo apt install postgresql-client libmsgpack-dev
- install_dependencies
- persist_to_workspace:
root: '~/rails_template'
root: &root '~/rails_template'
paths: '*'

rubocop:
working_directory: *root
docker:
- *ruby_docker
steps:
- attach_workspace:
at: *root
- run:
name: Run rubocop
command: bundle exec rubocop

eslint:
# We don't actually need any of the ruby environment to lint JS... but use what we have for now.
working_directory: ~/rails_template
docker:
- image: cimg/ruby:3.0.3-browsers
Expand All @@ -51,24 +63,21 @@ jobs:
at: '~/rails_template'
- install_dependencies
- run:
name: Run rubocop
command: bundle exec rubocop
name: Run eslint
command: yarn run eslint app/assets app/javascript

test:
working_directory: ~/rails_template
working_directory: *root
docker:
- image: cimg/ruby:3.0.3-browsers
environment:
RAILS_ENV: test
- *ruby_docker
- image: postgres:13.5-alpine
environment:
POSTGRES_USER: rails_template_user
POSTGRES_DB: test_db
POSTGRES_HOST_AUTH_METHOD: trust
steps:
- attach_workspace:
at: '~/rails_template'
- install_dependencies
at: *root
- browser-tools/install-browser-tools
- run:
name: Wait for PostgreSQL
Expand All @@ -93,3 +102,6 @@ workflows:
- rubocop:
requires:
- build
- eslint:
requires:
- build
28 changes: 28 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
env:
browser: true
es2021: true
extends: 'airbnb-base'
overrides: []
parserOptions:
ecmaVersion: latest
sourceType: module
ignorePatterns:
'app/javascript/entrypoints/vendor/**'
rules:
block-scoped-var: off
camelcase: off
eqeqeq: off
import/prefer-default-export: off
no-alert: off
no-console: off
no-param-reassign: off
no-plusplus: off
no-redeclare: off
no-restricted-globals: off
no-restricted-syntax: off
no-undef: off
no-underscore-dangle: off
no-unused-vars: off
no-var: off
prefer-const: off
vars-on-top: off
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ Metrics/BlockLength:
Metrics/ClassLength:
Exclude:
- "app/services/s3_query_service.rb"
- "app/models/pdc_metadata/resource.rb"

Metrics/MethodLength:
Exclude:
- "app/models/work.rb"
- "spec/support/work_s3_requests_specs.rb"

Metrics/ParameterLists:
Enabled: false
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ gem "datacite", github: "sul-dlss/datacite-ruby", branch: "main"

gem "kramdown"

gem "net-smtp"

group :development, :test do
gem "bixby"
gem "byebug"
Expand Down
14 changes: 11 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ GEM
i18n (1.12.0)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
io-wait (0.2.0)
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
Expand Down Expand Up @@ -235,16 +236,21 @@ GEM
msgpack (1.5.1)
mustermann (1.1.1)
ruby2_keywords (~> 0.0.1)
net-protocol (0.1.1)
io-wait
timeout
net-scp (3.0.0)
net-ssh (>= 2.6.5, < 7.0.0)
net-smtp (0.3.2)
net-protocol
net-ssh (6.1.0)
nio4r (2.5.8)
nokogiri (1.13.8)
nokogiri (1.13.9)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
nokogiri (1.13.8-x86_64-darwin)
nokogiri (1.13.9-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.13.8-x86_64-linux)
nokogiri (1.13.9-x86_64-linux)
racc (~> 1.4)
omniauth (1.9.2)
hashie (>= 3.4.6)
Expand Down Expand Up @@ -403,6 +409,7 @@ GEM
thor (1.2.1)
thread_safe (0.3.6)
tilt (2.0.10)
timeout (0.1.1)
tins (1.31.0)
sync
turbolinks (5.2.1)
Expand Down Expand Up @@ -485,6 +492,7 @@ DEPENDENCIES
jbuilder (~> 2.7)
kramdown
listen (~> 3.3)
net-smtp
nokogiri (>= 1.13.4)
omniauth-cas
pg
Expand Down
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,19 @@ Cataloging application for PDC content and more
## Local development

### Setup
1. Check out code
2. `bundle install`
3. `yarn install`
1. Check out code and `cd`
1. Install tool dependencies
1. [Lando](https://docs.lando.dev/getting-started/installation.html)
1. [asdf](https://asdf-vm.com/guide/getting-started.html#_2-download-asdf)
1. Install asdf dependencies
1. `asdf plugin add ruby`
1. `asdf plugin add node`
1. `asdf plugin add yarn`
1. `asdf install`
1. ... but because asdf is not a dependency manager, if there are errors, you may need to install other dependencies. For example: `brew install gpg`
1. Install language-specific dependencies
1. `bundle install`
1. `yarn install`

### Starting / stopping services
We use lando to run services required for both test and development environments.
Expand All @@ -40,10 +50,9 @@ To stop database services:
## DataCite integration
We use DataCite to mint DOIs and in production you must to define the `DATACITE_*` environment values indicated [here](https://github.com/pulibrary/princeton_ansible/blob/main/group_vars/pdc_describe/production.yml) for the system to run. During development if you do not set these values the system will use a hard-coded DOI.

## Deploying
pulbot: `pulbot deploy pdc_describe to [staging|production]`
## Release and deployment

To create a tagged release use the [steps in the RDSS handbook](https://github.com/pulibrary/rdss-handbook/blob/main/release_process.md)
RDSS uses the same [release and deployment process](https://github.com/pulibrary/rdss-handbook/blob/main/release_process.md) for all projects.

## Design
An early stages Entity-Relationship Diagram (ERD) is available in [this Google Doc](https://docs.google.com/drawings/d/1q2sfj8rrcNVgqQPK5uT_t79A9SYqncinh3HbnCSGMyQ/edit).
Expand Down
1 change: 1 addition & 0 deletions app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
//= link_tree ../images
//= link_directory ../stylesheets .css
//= link edit_utils.js
Loading

0 comments on commit 8236f08

Please sign in to comment.