Sign inSign up

ucsdets/aws-educate

By ucsdets

•Updated about 2 years ago

Image
0

8.5K

ucsdets/aws-educate repository overview

⁠Setup

Pre-requisites

Get these things before you start:

  1. Java SDK⁠
  2. Eclipse⁠
  3. Postgres⁠
  4. An Amazon access key with access to IAM, EC2, STS, and CloudTrail

Instructions

  1. pgAdmin⁠, the Postgres management tools, should have been installed with the Postgres installer. Use pgAdmin to create a database named awsed. Don't worry about creating the tables, they are created the first time the application runs.

  2. Clone the AWS Educate git repository⁠. Import the project into Eclipse using File -> Import -> Existing Maven Projects.

  3. Create a Spring Boot configuration file named application-default.yml. Put it in the src\main\resources folder. Fill in the Amazon credentials and database information.

     aws:
       account: SECRET
       accessKeyId: SECRET
       secretKey: SECRET
     testing:
       enabled: true
       username: admin
     spring:
       datasource:
         url: jdbc:postgresql://localhost/awsed
         username: postgres
         password: SECRET
         driver-class-name: org.postgresql.Driver
    
  4. Find the class EcmApplication in the /src/main/java/edu/ucsd/ecm/web folder (pro-tip: use CTRL+SHIFT+T).

  5. Right-click the EcmApplication file and choose Run As -> Java program.

  6. Assuming there were no errors, the database schema is created now. Run this script in pgAdmin to add a user named admin:

     insert into "user" (user_id, name) values ('5e21e9b6-5798-40c8-aea1-96fd844f4bbb', 'admin');
     insert into user_role (user_id, role) values ('5e21e9b6-5798-40c8-aea1-96fd844f4bbb', 'ROLE_ADMIN');
    
  7. Browse to http://localhost:8080/courses⁠.

⁠Configuration

These configuration options are available. When using YAML configuration⁠ use indentation instead of periods.

Refer to the Spring Boot documentation⁠ for further details.

PropertyDescription
testing.enabled(true or false) If true then the REMOTE_USER header is forced testing.username
testing.usernameUser to impersonate
spring.datasource.urlJDBC connection string, e.g. jdbc:postgresql://localhost:5432/awsed
spring.datasource.usernameDatabase user
spring.datasource.passwordDatabase user's password
spring.datasource.driver-class-nameJDBC driver class to use, e.g. org.postgresql.Driver
scheduler.enabledSet to false to disable scheduled tasks

⁠IntelliJ Configurations

⁠Configure VM options
  1. Run > Edit Configurations > Modify Options > Java: Add VM Options
  2. Copy the VM arguments below and paste it into the "VM options" field --add-opens java.base/java.lang=ALL-UNNAMED
  3. Click on "Apply" and then "Ok"

⁠Development Plugins

These plugins are optional. Get them from the Eclipse Marketplace.

  • Infinitest - Run unit tests after every code change
  • Checkstyle - Enforce coding rules

⁠Selenium Setup

There are two drivers:

  • edu.ucsd.ecm.web.controller.HtmlUnitWebDriverFactory (default)
  • edu.ucsd.ecm.web.controller.ChromeWebDriverFactory

By default the HtmlUnit driver is used so you won't see any output. To use chrome set:

-Dwebdriver.factory=edu.ucsd.ecm.web.controller.ChromeWebDriverFactory

as the command line argument to the test in eclipse.

Also make sure chromedriver is installed in c:\windows\system32 or other path that can be found by selenium.

https://chromedriver.chromium.org/downloads⁠

⁠Version Update

#mvn --batch-mode release:update-versions -DdevelopmentVersion=1.2.0-SNAPSHOT -DautoVersionSubmodules=true -DgenerateBackupPoms=false mvn --batch-mode versions:set -DnewVersion=2022.2.1-RC2 -DgenerateBackupPoms=false

Tag summary

Content type

Image

Digest

sha256:6c925175e…

Size

499.6 MB

Last updated

about 2 years ago

docker pull ucsdets/aws-educate:release-2024.4.0