- Add your SQL script to
resources.db.migrationdirectory - Add the following lines to your ~/.zshrc file:
export FLYWAY_URL="jdbc:mysql://YOUR_DB_HOST/YOUR_DB_NAME"
export FLYWAY_USER="YOUR_DB_USERNAME"
export FLYWAY_PASSWORD="YOUR_DB_PASSWORD"
export FLYWAY_BASELINE_ON_MIGRATE=true
- Reload your terminal session if required:
. ~/.zshrc
- Run Flyway command through Maven:
mvn flyway:migrate
- Add following secrets to your Github repo:
DB_USERNAME - the prod db username
DB_PASSWORD - the prod db password
DB_HOST - the prod db host
DB_NAME - the prod db name
- Raise a pull request with your script in the
resources.db.migrationdirectory - After approvals, merge pull request; this will trigger the migration action to run in Github
- Ensure migration successfully runs against prod database
- Set the following environment variables:
- DB_USERNAME
- DB_PASSWORD
- DB_HOST
- DB_NAME
- Run
mvn clean installto build your application - You can start application via IDE: Edit run configuration -> Add
serverto program arguments -> Run - To check that your application is running enter url
http://localhost:8080/api/test
To see your applications health enter url http://localhost:8081/healthcheck
Configure checkstyle in Intellij:
- Open Settings,
- Go to Tools, then Checkstyle,
- Under Configuration File, click Add,
- Type 'Sun Checks Modified' in the Description,
- Click Browse, then go to src/main/resources/sun_checks_modified,
- Click Next, then Next again, then Finish,
- Check the box for Active, then click Apply, then OK,
- Click on the CheckStyle button above the Terminal button and select Sun Checks Modified as the Rules.
- Open the .zshrc file
- Add the following lines to your ~/.zshrc file:
export "VALID_TEST_EMAIL"="user@email.com"
export "VALID_TEST_PASSWORD"="regularU\$er123"
export "VALID_ADMIN_EMAIL"="admin@email.com"
export VALID_ADMIN_PASSWORD="admin!Pa\$\$word123"
- Reload your terminal session if required:
. ~/.zshrc
- Reload IntelliJ if required