Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 2.84 KB

DEVELOP.md

File metadata and controls

60 lines (42 loc) · 2.84 KB

Development and deployment

How to build

$ mvn clean install

Database schema management

Project uses FlyWay DB for database schema versioning, and JOOQ framework for accessing database. After each impact on database schema, JOOQ supplementary classes regeneration must be launched. Regeneration procedure assumes that:

  • There is a Postgresql database instance, available at JDBC_URL: jdbc:postgresql://127.0.0.1:5432/postgres?user=postgres&password=postgres

To launch JOOQ sources regeneration:

$ mvn clean install -Pjooq-regenerate

Integration tests

Project uses integration testing, based on Testcontainers and Webdriver. Integration tests expect that:

  1. Chrome browser is installed on host
  2. Chrome webdriver of the version, compatible with installed Chrome browser, is installed and available in PATH
  3. Docker is installed on host and is online (see Testcontainers prerequisites)

Integration tests are supported only on Linux-based hosts. You can skip them by using either of two commands below:

$ mvn clean install -DskipTests

How to deploy

  1. Prerequisites: Oracle/Openjdk Java 8 or greater. Postgresql 10.
  2. Prepare postgres, GitHub OAuth integration and set up mandatory environment variables.
  3. mvn dependency:get -DgroupId=com.github.skapral.poetryclub -DartifactId=poetryclub-app -Dversion=<version number>
  4. java -jar poetryclub-app-*.jar

Note that Poetry Club supports also deployment to Dokku and Heroku.

Environment variables

Name Description
PORT Optional. Integer. Port number, to which the service is bound. Default is 5000.
OWNER Mandatory. Github login name for the user, owning the service instance. When logged in first time, this user will be prompted to craete a community.
JDBC_DATABASE_URL Mandatory. JDBC URL to the Postgresql database instance.
GITHUB_API_KEY Mandatory. Github OAuth application's API key.
GITHUB_API_SECRET Mandatory. Github OAuth application's API secret.
TEST_ENV Optional. If set, the instance will be deployed with stubbed authentication. Convenient for testing.
DOCKER_HOST Optional. Default is http://localhost:2375. Docker host, used by Testcontainers during integration tests execution