Enable to configure the port via the build options
This commit is contained in:
parent
bb70f7df4f
commit
96e4cd79ee
@ -78,7 +78,7 @@ program
|
|||||||
|
|
||||||
program
|
program
|
||||||
.command<{
|
.command<{
|
||||||
port: number;
|
port: number | undefined;
|
||||||
keycloakVersion: string | undefined;
|
keycloakVersion: string | undefined;
|
||||||
realmJsonFilePath: string | undefined;
|
realmJsonFilePath: string | undefined;
|
||||||
}>({
|
}>({
|
||||||
@ -96,7 +96,7 @@ program
|
|||||||
return name;
|
return name;
|
||||||
})(),
|
})(),
|
||||||
description: ["Keycloak server port.", "Example `--port 8085`"].join(" "),
|
description: ["Keycloak server port.", "Example `--port 8085`"].join(" "),
|
||||||
defaultValue: 8080
|
defaultValue: undefined
|
||||||
})
|
})
|
||||||
.option({
|
.option({
|
||||||
key: "keycloakVersion",
|
key: "keycloakVersion",
|
||||||
|
@ -72,6 +72,7 @@ export type BuildContext = {
|
|||||||
keycloakExtraArgs: string[];
|
keycloakExtraArgs: string[];
|
||||||
extensionJars: ({ type: "path"; path: string } | { type: "url"; url: string })[];
|
extensionJars: ({ type: "path"; path: string } | { type: "url"; url: string })[];
|
||||||
realmJsonFilePath: string | undefined;
|
realmJsonFilePath: string | undefined;
|
||||||
|
port: number | undefined;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -93,6 +94,7 @@ export type BuildOptions = {
|
|||||||
keycloakExtraArgs?: string[];
|
keycloakExtraArgs?: string[];
|
||||||
extensionJars?: string[];
|
extensionJars?: string[];
|
||||||
realmJsonFilePath?: string;
|
realmJsonFilePath?: string;
|
||||||
|
port?: number;
|
||||||
};
|
};
|
||||||
} & BuildOptions.AccountThemeImplAndKeycloakVersionTargets;
|
} & BuildOptions.AccountThemeImplAndKeycloakVersionTargets;
|
||||||
|
|
||||||
@ -328,7 +330,8 @@ export function getBuildContext(params: {
|
|||||||
extensionJars: z.array(z.string()).optional(),
|
extensionJars: z.array(z.string()).optional(),
|
||||||
realmJsonFilePath: z.string().optional(),
|
realmJsonFilePath: z.string().optional(),
|
||||||
dockerExtraArgs: z.array(z.string()).optional(),
|
dockerExtraArgs: z.array(z.string()).optional(),
|
||||||
keycloakExtraArgs: z.array(z.string()).optional()
|
keycloakExtraArgs: z.array(z.string()).optional(),
|
||||||
|
port: z.number().optional()
|
||||||
});
|
});
|
||||||
|
|
||||||
assert<Equals<z.infer<typeof zTargetType>, TargetType>>();
|
assert<Equals<z.infer<typeof zTargetType>, TargetType>>();
|
||||||
@ -967,7 +970,8 @@ export function getBuildContext(params: {
|
|||||||
: getAbsoluteAndInOsFormatPath({
|
: getAbsoluteAndInOsFormatPath({
|
||||||
pathIsh: buildOptions.startKeycloakOptions.realmJsonFilePath,
|
pathIsh: buildOptions.startKeycloakOptions.realmJsonFilePath,
|
||||||
cwd: projectDirPath
|
cwd: projectDirPath
|
||||||
})
|
}),
|
||||||
|
port: buildOptions.startKeycloakOptions?.port
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ import { rm } from "../tools/fs.rm";
|
|||||||
import { downloadAndExtractArchive } from "../tools/downloadAndExtractArchive";
|
import { downloadAndExtractArchive } from "../tools/downloadAndExtractArchive";
|
||||||
|
|
||||||
export type CliCommandOptions = CliCommandOptions_common & {
|
export type CliCommandOptions = CliCommandOptions_common & {
|
||||||
port: number;
|
port: number | undefined;
|
||||||
keycloakVersion: string | undefined;
|
keycloakVersion: string | undefined;
|
||||||
realmJsonFilePath: string | undefined;
|
realmJsonFilePath: string | undefined;
|
||||||
};
|
};
|
||||||
@ -337,7 +337,7 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
|||||||
const SPACE_PLACEHOLDER = "SPACE_PLACEHOLDER_xKLmdPd";
|
const SPACE_PLACEHOLDER = "SPACE_PLACEHOLDER_xKLmdPd";
|
||||||
|
|
||||||
const dockerRunArgs: string[] = [
|
const dockerRunArgs: string[] = [
|
||||||
`-p${SPACE_PLACEHOLDER}${cliCommandOptions.port}:8080`,
|
`-p${SPACE_PLACEHOLDER}${cliCommandOptions.port ?? buildContext.startKeycloakOptions.port ?? 8080}:8080`,
|
||||||
`--name${SPACE_PLACEHOLDER}${CONTAINER_NAME}`,
|
`--name${SPACE_PLACEHOLDER}${CONTAINER_NAME}`,
|
||||||
`-e${SPACE_PLACEHOLDER}KEYCLOAK_ADMIN=admin`,
|
`-e${SPACE_PLACEHOLDER}KEYCLOAK_ADMIN=admin`,
|
||||||
`-e${SPACE_PLACEHOLDER}KEYCLOAK_ADMIN_PASSWORD=admin`,
|
`-e${SPACE_PLACEHOLDER}KEYCLOAK_ADMIN_PASSWORD=admin`,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user