parent
b4281468d0
commit
e3d294e988
2 changed files with 12 additions and 12 deletions
|
@ -28,22 +28,16 @@ public abstract class AbstractExportImportCommand extends AbstractStartCommand i
|
|||
|
||||
@Option(names = "--dir",
|
||||
arity = "1",
|
||||
description = "Set the path to a directory where files will be created with the exported data.",
|
||||
description = "Set the path to a directory where files will be read from when importing or created with the exported data.",
|
||||
paramLabel = "<path>")
|
||||
String toDir;
|
||||
|
||||
@Option(names = "--file",
|
||||
arity = "1",
|
||||
description = "Set the path to a file that will be created with the exported data.",
|
||||
description = "Set the path to a file that will be read when importing or created with the exported data.",
|
||||
paramLabel = "<path>")
|
||||
String toFile;
|
||||
|
||||
@Option(names = "--realm",
|
||||
arity = "1",
|
||||
description = "Set the name of the realm to export",
|
||||
paramLabel = "<realm>")
|
||||
String realm;
|
||||
|
||||
protected AbstractExportImportCommand(String action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
@ -62,10 +56,6 @@ public abstract class AbstractExportImportCommand extends AbstractStartCommand i
|
|||
executionError(spec.commandLine(), "Must specify either --dir or --file options.");
|
||||
}
|
||||
|
||||
if (realm != null) {
|
||||
System.setProperty("keycloak.migration.realmName", realm);
|
||||
}
|
||||
|
||||
Environment.setProfile(Environment.IMPORT_EXPORT_MODE);
|
||||
|
||||
super.run();
|
||||
|
|
|
@ -41,12 +41,22 @@ public final class Export extends AbstractExportImportCommand implements Runnabl
|
|||
defaultValue = "50")
|
||||
Integer usersPerFile;
|
||||
|
||||
@Option(names = "--realm",
|
||||
arity = "1",
|
||||
description = "Set the name of the realm to export",
|
||||
paramLabel = "<realm>")
|
||||
String realm;
|
||||
|
||||
public Export() {
|
||||
super(ACTION_EXPORT);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doBeforeRun() {
|
||||
if (realm != null) {
|
||||
System.setProperty("keycloak.migration.realmName", realm);
|
||||
}
|
||||
|
||||
System.setProperty("keycloak.migration.usersExportStrategy", users.toUpperCase());
|
||||
|
||||
if (usersPerFile != null) {
|
||||
|
|
Loading…
Reference in a new issue