Table of Contents | ||||||
---|---|---|---|---|---|---|
|
Repos + Setup
...
CUL Online Exhibitions:
https://github.com/cul-it/exhibits-library-cornell-edu
...
...
- Local development setup instructions in README
- Recommended setup: Docker
...
Spotlight engine:
https://github.com/projectblacklight/spotlight
...
...
Blacklight engine:
...
- mkdir cornellexhibittest (you may name the directory whatever you wish)
- cd cornellexhibittest
- git clone git@github.com:cul-it/exhibits-library-cornell-edu.git .
- (I used RVM so had to ensure the right version of Ruby was being employed. "rvm use 2.7.3")
- bundle install
- bin/rake db:migrate
- cp .env.example .env
- Look through the .env file and follow the instructions for setting up the database (under the #mysql section) and setting up the database name, username, and password
- For Solr URL, you can try the Solr wrapper method. I also set up a separate Solr index using the schema files I saw being used and then set Solr _URL to point to my local Solr URL
- Update SITE_ADMINS to include the site admin user email addresses you want to use
- Generate a Devise secret key as the instructions tell you
- "rails server" to start the system
- Go to sign up and enter the email you already added to the site admins and create a password. When you login, you should be able to see the "Site Administration" link under your email address on the top right of the page.
...
- https://github.com/cul-it/exhibits-library-cornell-edu/wiki/Release-Process although portions may be out of date.
- Updating dev (or setting up a pull request) will kick off CircleCI (see below - you should have logged in to CircleCI already for this to take effect, it appears). If you want to see any console output and/or what may not be passing, you can check CircleCI logs . You can also run rubocop directly on the code by going to the top level directory and running bin/rubocop and see the resulting messages.
- To actually build from a branch onto one of the servers, you must do the following
- Example: Deploying dev to the integration branch.
- Go to "https://awsjenkins.library.cornell.edu/job/exhibits-integration" . (If you need access, please ask Greg!)
- Build with parameters
- Pick the dev branch in the list of branches
- Select "build"
- You can see the build currently underway on the bottom left section. Clicking on that will show you console output.
- Under AWS Jenkins, (https://awsjenkins.library.cornell.edu), you can find "exhibits-staging-1" and "exhibits-prod-1" which deploy to staging and production separately. Production is set to deploy from the main branch and will not let you pick a different branch to deploy.
- Example: Deploying dev to the integration branch.
- You may find that you need to do a restart of the application in AWS Elastic Beanstalk if you run into an issue, (Please ask Greg where to get the URL). Go to elastic beanstalk and then find "exhibits-integration" if deploying to integration or "exhibits-prod-1" if deploying to production. Under "Actions" (top right), select "rebuild environment". It would be best to have Greg available to contact in case you need help when you this yourself.
...
- Databases
- Please ask Greg for the username and password for the database, as in integration, staging, and production we are using AWS RDS, and the username and passwords are stored in LastPass.
- The databases include various tables for storing user information, but also information about the "resources" which include the exhibits themselves. You can see the schema here https://github.com/cul-it/exhibits-library-cornell-edu/blob/dev/db/schema.rb or login to MySQL (or Sqlite3, depending on your rails app database setup) and access the database on your local machine to get a sense of which data is stored where.
- Solr index
- There are separate indices used for integration, staging, and production. The Solr index captures the main metadata for the resources (e.g. title, description, copyright, etc.) and the location of the images that are uploaded and to which exhibit these items correspond. (Based on experience with the code, this information isn't published to the Solr index until the exhibit itself has been published. Until that point, it appears the information about exhibits and related images is stored elsewhere. You may wish to confirm.)
- Rails app
- The rails app code relies on the Spotlight gem. You can check the Gemfile to see which version (currently at Spotlight 3.3). https://github.com/cul-it/exhibits-library-cornell-edu/blob/dev/Gemfile#L68
- AWS storage for images (unsure so needs confirmation)
- You may wish to confirm but the actual files are possibly being stored in AWS S3.
...
Architecture
Current architecture: Components: Servers, Solr index and Rails database
Upcoming architecture: Components: Containers, Solr index and Rails database
- Follow Jira tickets for container migration status:
Deployment
Current deployment
- integration: exhibits-int-ruby3-deploy
- IMPT: Currently deploys to exhibits-container integration environment, NOT exhibits-int.
- Build with parameters > select BRANCH > Build
- staging: exhibits-stg-ruby3-deploy
- "Build now" deploys only the main branch
- production: exhibits-prod-ruby3-deploy
- "Build now" deploys only the main branch
Production Deploy Process
- Create a main > dev PR and add all contributors as Reviewers
- Once the PR is accepted, merge to main and deploy main to staging via exhibits-stg-ruby3-deploy Jenkins build
- Verify new changes were deployed successfully and test on staging
- Announce upcoming production deploy in #exhibits Slack channel
- Deploy to production via exhibits-prod-ruby3-deploy Jenkins build
- Verify all looks well on https://exhibits.library.cornell.edu/
- Update Developer Release Notes
Upcoming deployment
COMING SOON
CircleCI for Automated Testing and Linting
A new CircleCI build is automatically triggered with every new git push on any branch and checks that rspec and rubocop builds pass. There is an open Jira ticket to move this to Jenkins: https://culibrary.atlassian.net/browse/LP-195
- Login to http://circleci.com. You will need to login and connect to the repository before the built-in GitHub CircleCI can kick off and before you can see the output of those CircleCI processes.
- Pick login with GitHub
- Go to Projects
- Pick "exhibits-library-cornell-edu"
Site Admins
CUL Online Exhibitions has 2 levels of site admin access for users:
- Superadmins: can create new exhibits
- Run
bundle exec rake spotlight:initialize
to set new superadmin user.
- Run
- Site admins: can access and manage any and everything
- Add user email to
SITE_ADMINS
environment variable in dotenv file.
- Add user email to
The site can also be further locked so that exhibits are only read-only to everyone besides site admins by setting the ACCESS_MODE
environment variable to SITE_ADMIN_ONLY
. When ACCESS_MODE=SITE_ADMIN_ONLY
, a message displays at the top of the page for logged in users: "Exhibits are in maintenance mode. Editing is unavailable at this time."
Group Exchange Accounts / Emails
- Cornell Library Online Exhibits Notifications (ga.culit-exhibits): Cornell Library Online Exhibits Notifications
- Emails: culit-exhibits@cornell.edu, notifications-exhibits-library@cornell.edu
EMAIL_FROM=notifications-exhibits-library@cornell.edu
in prod env vars
- Emails: culit-exhibits@cornell.edu, notifications-exhibits-library@cornell.edu
- Cornell Library Online Exhibits Help (ga.culit-exhibits-h): Cornell Library Online Exhibits Help
- Emails: culit-exhibits-h@cornell.edu, help-exhibits-library@cornell.edu
- Referred to from Curator Documentation
- Emails: culit-exhibits-h@cornell.edu, help-exhibits-library@cornell.edu
- Adding site admin email addresses
- Cornell exhibits has an added layer of permissions for a site wide admin which is defined in the elastic bean stalk configuration.
- Access elastic beanstalk environments through the AWS console. Look for exhibits-integration or exhibits-prod-1.
- Go to configuration → software
- Click edit and go to environment properties
- Edit "SITE_ADMINS" and add the email addresses you like (email addresses are separated by semi-colons)
- Click "Apply" to update the configuration
- Go to configuration → software
- After updating the configuration, rebuild environment. (Restarting the app seems insufficient and leaves the site down)
- If you are deploying the system locally, set up a .env file based on https://github.com/cul-it/exhibits-library-cornell-edu/blob/dev/.env.example
- Access elastic beanstalk environments through the AWS console. Look for exhibits-integration or exhibits-prod-1.
- Cornell exhibits has an added layer of permissions for a site wide admin which is defined in the elastic bean stalk configuration.
- Signing up an external user
- Ask the user to click on "Admin Login" on the bottom of the page and then select "Sign up". This should take them to https://exhibits.library.cornell.edu/users/sign_up
- Once they have signed up, login as administrator into the site. Go to "Manage Users" under Actions. You can change their role in general under this section (e.g. make someone an "admin"). You can also select a particular exhibit, go to "Exhibit Dashboard" in the menu under your email address on the top right of the page, and then "Configuration" in the left column. Click on "Users" under Configuration and you can select "add a new user" to add this user to the list of people who have roles for this specific exhibit.