This is the main repository for the Pennsieve api and shared core library of middleware for interacting with the graph store. The project is currently composed of the api code in the api sub directory and the core middelware code in the core subdirectory.
- Dev - Merges into the
DEVELOPMENTbranch will automatically deploy to the dev envionment. - Prod - Merges into the
masterbranch require a manual deploy here.
To develop effectively with this project you will need the following tools:
This project is set up to use docker to quickly develop locally using testcontainers-scala
You will need access to the nexus repository manager. Once an account has been created for you, add the following to your .bashrc or .zshrc file:
export PENNSIEVE_NEXUS_USER=[NEXUS USERNAME]
export PENNSIEVE_NEXUS_PW=[REDACTED]
For intellij to work you will also need to add the following file at ~/Library/LaunchAgents/environment.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>my.startup</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>
<string>
launchctl setenv PENNSIEVE_NEXUS_USER [NEXUS_USERNAME]
launchctl setenv PENNSIEVE_NEXUS_PW [REDACTED]
</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
Then run launchctl load ~/Library/LaunchAgents/environment.plist and restart intellij for it to talk to the
nexus server. You don't need to rerun this command as OSX will do it for you in the future. To compile or test code
across both projects use the regular sbt commands:
sbt +compile
sbt +testThe leading + will take care of cross compiling any modules that are configured for more than one version of Scala.
To run just the the core compile or test by themselves use
sbt core/compile
sbt core/testSQL migrations live in the separate pennsieve-db-migrations repo, which publishes the pennsieve/pennsievedb:*-seed Docker image consumed by the test harness here. There is no in-process migration step in this repo — tests start against the already-migrated seed image. To add or modify migrations, open a PR in pennsieve-db-migrations.
When a new seed image is published, bump the pinned tag in core/src/test/scala/com/pennsieve/test/PostgresDockerContainer.scala.
Merging to main deploys all services in this repo to the dev environment. Postgres migrations run from the pennsieve-db-migrations pipeline, not this one.
Individual services are deployed to production via Jenkins service-deploy jobs. Use the pennsieve-api-release job to deploy all services to production and (optionally) run the Postgres migrations.
rev. 2024/07/31