keycloakify 10.0.0-rc.138 → 10.0.0-rc.139
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/526.index.js +17 -14
- package/package.json +1 -1
- package/src/bin/start-keycloak/start-keycloak.ts +21 -16
package/bin/526.index.js
CHANGED
@@ -735,20 +735,21 @@ async function command(params) {
|
|
735
735
|
});
|
736
736
|
}
|
737
737
|
catch (_e) { }
|
738
|
+
const SPACE_PLACEHOLDER = "SPACE_PLACEHOLDER_xKLmdPd";
|
738
739
|
const dockerRunArgs = [
|
739
|
-
`-p
|
740
|
-
`--name
|
741
|
-
`-e
|
742
|
-
`-e
|
740
|
+
`-p${SPACE_PLACEHOLDER}${cliCommandOptions.port}:8080`,
|
741
|
+
`--name${SPACE_PLACEHOLDER}${constants/* CONTAINER_NAME */.sv}`,
|
742
|
+
`-e${SPACE_PLACEHOLDER}KEYCLOAK_ADMIN=admin`,
|
743
|
+
`-e${SPACE_PLACEHOLDER}KEYCLOAK_ADMIN_PASSWORD=admin`,
|
743
744
|
...(realmJsonFilePath === undefined
|
744
745
|
? []
|
745
746
|
: [
|
746
|
-
`-v
|
747
|
+
`-v${SPACE_PLACEHOLDER}".${external_path_.sep}${(0,external_path_.relative)(process.cwd(), realmJsonFilePath)}":/opt/keycloak/data/import/myrealm-realm.json`
|
747
748
|
]),
|
748
|
-
`-v
|
749
|
-
...extensionJarFilePaths.map(jarFilePath => `-v
|
749
|
+
`-v${SPACE_PLACEHOLDER}"./${(0,external_path_.relative)(process.cwd(), jarFilePath_cacheDir)}":/opt/keycloak/providers/keycloak-theme.jar`,
|
750
|
+
...extensionJarFilePaths.map(jarFilePath => `-v${SPACE_PLACEHOLDER}".${external_path_.sep}${(0,external_path_.relative)(process.cwd(), jarFilePath)}":/opt/keycloak/providers/${(0,external_path_.basename)(jarFilePath)}`),
|
750
751
|
...(keycloakMajorVersionNumber <= 20
|
751
|
-
? [
|
752
|
+
? [`-e${SPACE_PLACEHOLDER}JAVA_OPTS=-Dkeycloak.profile=preview`]
|
752
753
|
: []),
|
753
754
|
...[
|
754
755
|
...buildContext.themeNames,
|
@@ -760,26 +761,28 @@ async function command(params) {
|
|
760
761
|
localDirPath: (0,external_path_.join)(buildContext.keycloakifyBuildDirPath, "theme", themeName),
|
761
762
|
containerDirPath: `/opt/keycloak/themes/${themeName}`
|
762
763
|
}))
|
763
|
-
.map(({ localDirPath, containerDirPath }) => `-v
|
764
|
+
.map(({ localDirPath, containerDirPath }) => `-v${SPACE_PLACEHOLDER}".${external_path_.sep}${(0,external_path_.relative)(process.cwd(), localDirPath)}":${containerDirPath}:rw`),
|
764
765
|
...buildContext.environmentVariables
|
765
766
|
.map(({ name }) => ({ name, envValue: process.env[name] }))
|
766
767
|
.map(({ name, envValue }) => envValue === undefined ? undefined : { name, envValue })
|
767
768
|
.filter((0,exclude.exclude)(undefined))
|
768
|
-
.map(({ name, envValue }) => `--env
|
769
|
-
...buildContext.startKeycloakOptions.dockerExtraArgs,
|
769
|
+
.map(({ name, envValue }) => `--env${SPACE_PLACEHOLDER}${name}='${envValue.replace(/'/g, "'\\''")}'`),
|
770
|
+
...buildContext.startKeycloakOptions.dockerExtraArgs.join(SPACE_PLACEHOLDER),
|
770
771
|
`${(_b = (_a = buildContext.startKeycloakOptions.dockerImage) === null || _a === void 0 ? void 0 : _a.reference) !== null && _b !== void 0 ? _b : "quay.io/keycloak/keycloak"}:${dockerImageTag}`,
|
771
772
|
"start-dev",
|
772
773
|
...(21 <= keycloakMajorVersionNumber && keycloakMajorVersionNumber < 24
|
773
774
|
? ["--features=declarative-user-profile"]
|
774
775
|
: []),
|
775
776
|
...(realmJsonFilePath === undefined ? [] : ["--import-realm"]),
|
776
|
-
...buildContext.startKeycloakOptions.keycloakExtraArgs
|
777
|
+
...buildContext.startKeycloakOptions.keycloakExtraArgs.join(SPACE_PLACEHOLDER)
|
777
778
|
];
|
778
779
|
console.log(source_default().blue([
|
779
780
|
`$ docker run \\`,
|
780
|
-
...dockerRunArgs
|
781
|
+
...dockerRunArgs
|
782
|
+
.map(arg => arg.replace(new RegExp(SPACE_PLACEHOLDER, "g"), " "))
|
783
|
+
.map((line, i, arr) => ` ${line}${arr.length - 1 === i ? "" : " \\"}`)
|
781
784
|
].join("\n")));
|
782
|
-
const child = external_child_process_.spawn("docker", ["run", ...dockerRunArgs.map(line => line.split(
|
785
|
+
const child = external_child_process_.spawn("docker", ["run", ...dockerRunArgs.map(line => line.split(SPACE_PLACEHOLDER)).flat()], { shell: true });
|
783
786
|
child.stdout.on("data", data => process.stdout.write(data));
|
784
787
|
child.stderr.on("data", data => process.stderr.write(data));
|
785
788
|
child.on("exit", process.exit);
|
package/package.json
CHANGED
@@ -334,23 +334,25 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
|
334
334
|
});
|
335
335
|
} catch {}
|
336
336
|
|
337
|
+
const SPACE_PLACEHOLDER = "SPACE_PLACEHOLDER_xKLmdPd";
|
338
|
+
|
337
339
|
const dockerRunArgs: string[] = [
|
338
|
-
`-p
|
339
|
-
`--name
|
340
|
-
`-e
|
341
|
-
`-e
|
340
|
+
`-p${SPACE_PLACEHOLDER}${cliCommandOptions.port}:8080`,
|
341
|
+
`--name${SPACE_PLACEHOLDER}${CONTAINER_NAME}`,
|
342
|
+
`-e${SPACE_PLACEHOLDER}KEYCLOAK_ADMIN=admin`,
|
343
|
+
`-e${SPACE_PLACEHOLDER}KEYCLOAK_ADMIN_PASSWORD=admin`,
|
342
344
|
...(realmJsonFilePath === undefined
|
343
345
|
? []
|
344
346
|
: [
|
345
|
-
`-v
|
347
|
+
`-v${SPACE_PLACEHOLDER}".${pathSep}${pathRelative(process.cwd(), realmJsonFilePath)}":/opt/keycloak/data/import/myrealm-realm.json`
|
346
348
|
]),
|
347
|
-
`-v
|
349
|
+
`-v${SPACE_PLACEHOLDER}"./${pathRelative(process.cwd(), jarFilePath_cacheDir)}":/opt/keycloak/providers/keycloak-theme.jar`,
|
348
350
|
...extensionJarFilePaths.map(
|
349
351
|
jarFilePath =>
|
350
|
-
`-v
|
352
|
+
`-v${SPACE_PLACEHOLDER}".${pathSep}${pathRelative(process.cwd(), jarFilePath)}":/opt/keycloak/providers/${pathBasename(jarFilePath)}`
|
351
353
|
),
|
352
354
|
...(keycloakMajorVersionNumber <= 20
|
353
|
-
? [
|
355
|
+
? [`-e${SPACE_PLACEHOLDER}JAVA_OPTS=-Dkeycloak.profile=preview`]
|
354
356
|
: []),
|
355
357
|
...[
|
356
358
|
...buildContext.themeNames,
|
@@ -374,7 +376,7 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
|
374
376
|
}))
|
375
377
|
.map(
|
376
378
|
({ localDirPath, containerDirPath }) =>
|
377
|
-
`-v
|
379
|
+
`-v${SPACE_PLACEHOLDER}".${pathSep}${pathRelative(process.cwd(), localDirPath)}":${containerDirPath}:rw`
|
378
380
|
),
|
379
381
|
...buildContext.environmentVariables
|
380
382
|
.map(({ name }) => ({ name, envValue: process.env[name] }))
|
@@ -384,32 +386,35 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
|
384
386
|
.filter(exclude(undefined))
|
385
387
|
.map(
|
386
388
|
({ name, envValue }) =>
|
387
|
-
`--env
|
389
|
+
`--env${SPACE_PLACEHOLDER}${name}='${envValue.replace(/'/g, "'\\''")}'`
|
388
390
|
),
|
389
|
-
...buildContext.startKeycloakOptions.dockerExtraArgs,
|
391
|
+
...buildContext.startKeycloakOptions.dockerExtraArgs.join(SPACE_PLACEHOLDER),
|
390
392
|
`${buildContext.startKeycloakOptions.dockerImage?.reference ?? "quay.io/keycloak/keycloak"}:${dockerImageTag}`,
|
391
393
|
"start-dev",
|
392
394
|
...(21 <= keycloakMajorVersionNumber && keycloakMajorVersionNumber < 24
|
393
395
|
? ["--features=declarative-user-profile"]
|
394
396
|
: []),
|
395
397
|
...(realmJsonFilePath === undefined ? [] : ["--import-realm"]),
|
396
|
-
...buildContext.startKeycloakOptions.keycloakExtraArgs
|
398
|
+
...buildContext.startKeycloakOptions.keycloakExtraArgs.join(SPACE_PLACEHOLDER)
|
397
399
|
];
|
398
400
|
|
399
401
|
console.log(
|
400
402
|
chalk.blue(
|
401
403
|
[
|
402
404
|
`$ docker run \\`,
|
403
|
-
...dockerRunArgs
|
404
|
-
(
|
405
|
-
|
405
|
+
...dockerRunArgs
|
406
|
+
.map(arg => arg.replace(new RegExp(SPACE_PLACEHOLDER, "g"), " "))
|
407
|
+
.map(
|
408
|
+
(line, i, arr) =>
|
409
|
+
` ${line}${arr.length - 1 === i ? "" : " \\"}`
|
410
|
+
)
|
406
411
|
].join("\n")
|
407
412
|
)
|
408
413
|
);
|
409
414
|
|
410
415
|
const child = child_process.spawn(
|
411
416
|
"docker",
|
412
|
-
["run", ...dockerRunArgs.map(line => line.split(
|
417
|
+
["run", ...dockerRunArgs.map(line => line.split(SPACE_PLACEHOLDER)).flat()],
|
413
418
|
{ shell: true }
|
414
419
|
);
|
415
420
|
|