mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
Run Liquibase migrations blocking before startup.
This commit is contained in:
parent
1175a1c6c3
commit
e32ffb16a1
2 changed files with 14 additions and 8 deletions
8
.github/workflows/docker-build-test.yml
vendored
8
.github/workflows/docker-build-test.yml
vendored
|
@ -23,6 +23,12 @@ jobs:
|
||||||
- Dockerfile.azul.ci
|
- Dockerfile.azul.ci
|
||||||
- Dockerfile.openj9.ci
|
- Dockerfile.openj9.ci
|
||||||
- Dockerfile.graalvm-jvm.ci
|
- Dockerfile.graalvm-jvm.ci
|
||||||
|
include:
|
||||||
|
- sleep: 20
|
||||||
|
- docker-compose-file: testing/docker-compose.cockroachdb.yml
|
||||||
|
sleep: 30
|
||||||
|
- docker-compose-file: testing/docker-compose.yugabytedb.yml
|
||||||
|
sleep: 120
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
@ -45,7 +51,7 @@ jobs:
|
||||||
file: ${{ matrix.dockerfile }}
|
file: ${{ matrix.dockerfile }}
|
||||||
tags: 1337kavin/piped:latest
|
tags: 1337kavin/piped:latest
|
||||||
- name: Start Docker-Compose services
|
- name: Start Docker-Compose services
|
||||||
run: docker-compose -f ${{ matrix.docker-compose-file }} up -d && sleep 20
|
run: docker-compose -f ${{ matrix.docker-compose-file }} up -d && sleep ${{ matrix.sleep }}
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: ./testing/api-test.sh
|
run: ./testing/api-test.sh
|
||||||
- name: Collect services logs
|
- name: Collect services logs
|
||||||
|
|
|
@ -46,6 +46,13 @@ public class Main {
|
||||||
|
|
||||||
Injector.useSpecializer();
|
Injector.useSpecializer();
|
||||||
|
|
||||||
|
try {
|
||||||
|
LiquibaseHelper.init();
|
||||||
|
} catch (Exception e) {
|
||||||
|
ExceptionHandler.handle(e);
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
Multithreading.runAsync(() -> new Thread(new SyncRunner(
|
Multithreading.runAsync(() -> new Thread(new SyncRunner(
|
||||||
new OkHttpClient.Builder().readTimeout(60, TimeUnit.SECONDS).build(),
|
new OkHttpClient.Builder().readTimeout(60, TimeUnit.SECONDS).build(),
|
||||||
MATRIX_SERVER,
|
MATRIX_SERVER,
|
||||||
|
@ -69,13 +76,6 @@ public class Main {
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
|
|
||||||
try {
|
|
||||||
LiquibaseHelper.init();
|
|
||||||
} catch (Exception e) {
|
|
||||||
ExceptionHandler.handle(e);
|
|
||||||
System.exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
try (Session ignored = DatabaseSessionFactory.createSession()) {
|
try (Session ignored = DatabaseSessionFactory.createSession()) {
|
||||||
System.out.println("Database connection is ready!");
|
System.out.println("Database connection is ready!");
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
|
|
Loading…
Reference in a new issue