Load custom extention for logging realm change
This commit is contained in:
39
scripts/build/downloadKeycloakifyLogging.ts
Normal file
39
scripts/build/downloadKeycloakifyLogging.ts
Normal file
@ -0,0 +1,39 @@
|
||||
import { downloadAndExtractArchive } from "../../src/bin/tools/downloadAndExtractArchive";
|
||||
import { cacheDirPath } from "../shared/cacheDirPath";
|
||||
import { getProxyFetchOptions } from "../../src/bin/tools/fetchProxyOptions";
|
||||
import { getThisCodebaseRootDirPath } from "../../src/bin/tools/getThisCodebaseRootDirPath";
|
||||
import { existsAsync } from "../../src/bin/tools/fs.existsAsync";
|
||||
import * as fs from "fs/promises";
|
||||
import {
|
||||
KEYCLOAKIFY_LOGGING_VERSION,
|
||||
KEYCLOAKIFY_LOGIN_JAR_BASENAME
|
||||
} from "../../src/bin/shared/constants";
|
||||
import { join as pathJoin } from "path";
|
||||
|
||||
export async function downloadKeycloakifyLogging(params: { distDirPath: string }) {
|
||||
const { distDirPath } = params;
|
||||
|
||||
const jarFilePath = pathJoin(
|
||||
distDirPath,
|
||||
"src",
|
||||
"bin",
|
||||
"start-keycloak",
|
||||
KEYCLOAKIFY_LOGIN_JAR_BASENAME
|
||||
);
|
||||
|
||||
if (await existsAsync(jarFilePath)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { archiveFilePath } = await downloadAndExtractArchive({
|
||||
cacheDirPath,
|
||||
fetchOptions: getProxyFetchOptions({
|
||||
npmConfigGetCwd: getThisCodebaseRootDirPath()
|
||||
}),
|
||||
url: `https://github.com/keycloakify/keycloakify-logging/releases/download/${KEYCLOAKIFY_LOGGING_VERSION}/keycloakify-logging-${KEYCLOAKIFY_LOGGING_VERSION}.jar`,
|
||||
uniqueIdOfOnArchiveFile: "no extraction",
|
||||
onArchiveFile: async () => {}
|
||||
});
|
||||
|
||||
await fs.cp(archiveFilePath, jarFilePath);
|
||||
}
|
@ -7,6 +7,7 @@ import { createAccountV1Dir } from "./createAccountV1Dir";
|
||||
import chalk from "chalk";
|
||||
import { run } from "../shared/run";
|
||||
import { vendorFrontendDependencies } from "./vendorFrontendDependencies";
|
||||
import { downloadKeycloakifyLogging } from "./downloadKeycloakifyLogging";
|
||||
|
||||
(async () => {
|
||||
console.log(chalk.cyan("Building Keycloakify..."));
|
||||
@ -148,9 +149,6 @@ import { vendorFrontendDependencies } from "./vendorFrontendDependencies";
|
||||
fs.cpSync(dirBasename, destDirPath, { recursive: true });
|
||||
}
|
||||
|
||||
await createPublicKeycloakifyDevResourcesDir();
|
||||
await createAccountV1Dir();
|
||||
|
||||
transformCodebase({
|
||||
srcDirPath: join("stories"),
|
||||
destDirPath: join("dist", "stories"),
|
||||
@ -163,6 +161,12 @@ import { vendorFrontendDependencies } from "./vendorFrontendDependencies";
|
||||
}
|
||||
});
|
||||
|
||||
await createPublicKeycloakifyDevResourcesDir();
|
||||
await createAccountV1Dir();
|
||||
await downloadKeycloakifyLogging({
|
||||
distDirPath: join(process.cwd(), "dist")
|
||||
});
|
||||
|
||||
console.log(
|
||||
chalk.green(`✓ built in ${((Date.now() - startTime) / 1000).toFixed(2)}s`)
|
||||
);
|
||||
|
Reference in New Issue
Block a user