S16 postgresql opslag added
All checks were successful
Build, test and publish / verify (push) Successful in 7m31s
All checks were successful
Build, test and publish / verify (push) Successful in 7m31s
This commit is contained in:
@@ -131,6 +131,29 @@ class Pipeline {
|
||||
"agiledancers-fe");
|
||||
Files.writeString(artifacts.resolve("containers-started"), "");
|
||||
run("docker", "network", "create", "--label", "agiledancers.ci.run=" + runName, runName);
|
||||
run(
|
||||
"docker",
|
||||
"run",
|
||||
"-d",
|
||||
"--name",
|
||||
runName + "-database",
|
||||
"--network",
|
||||
runName,
|
||||
"--network-alias",
|
||||
"database",
|
||||
"--env",
|
||||
"POSTGRES_USER=agiledancers",
|
||||
"--env",
|
||||
"POSTGRES_PASSWORD=ci-only",
|
||||
"--env",
|
||||
"POSTGRES_DB=agiledancers",
|
||||
"postgres:17.6");
|
||||
for (int attempt = 0; attempt < 60; attempt++) {
|
||||
if (result(false, "docker", "exec", runName + "-database", "pg_isready", "-U", "agiledancers")
|
||||
.code()
|
||||
== 0) break;
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
run(
|
||||
"docker",
|
||||
"run",
|
||||
@@ -153,6 +176,12 @@ class Pipeline {
|
||||
root.resolve("agiledancers-be/target/coverage-tools/agent.jar") + ":/jacoco-agent.jar:ro",
|
||||
"--env",
|
||||
"JAVA_TOOL_OPTIONS=-javaagent:/jacoco-agent.jar=output=tcpserver,address=*,port=6300",
|
||||
"--env",
|
||||
"DATABASE_URL=jdbc:postgresql://database:5432/agiledancers",
|
||||
"--env",
|
||||
"DATABASE_USER=agiledancers",
|
||||
"--env",
|
||||
"DATABASE_PASSWORD=ci-only",
|
||||
backendImage);
|
||||
run(
|
||||
"docker",
|
||||
@@ -328,13 +357,14 @@ class Pipeline {
|
||||
Files.copy(source, artifacts.resolve(data), StandardCopyOption.REPLACE_EXISTING);
|
||||
}
|
||||
if (result(false, "docker", "info").code() == 0) {
|
||||
for (String role : List.of("backend", "frontend", "browser")) {
|
||||
for (String role : List.of("backend", "frontend", "browser", "database")) {
|
||||
String container = runName + "-" + role;
|
||||
if (result(false, "docker", "container", "inspect", container).code() == 0) {
|
||||
var logs = result(false, "docker", "logs", container);
|
||||
Files.writeString(artifacts.resolve(role + ".log"), logs.output());
|
||||
if (logs.code() != 0) failures.add(role + " logs");
|
||||
if (result(false, "docker", "rm", "-f", container).code() != 0) failures.add(role + " cleanup");
|
||||
if (result(false, "docker", "rm", "-f", "-v", container).code() != 0)
|
||||
failures.add(role + " cleanup");
|
||||
}
|
||||
}
|
||||
if (result(false, "docker", "network", "inspect", runName).code() == 0
|
||||
|
||||
Reference in New Issue
Block a user