run method
Runs this command.
The return value is wrapped in a Future
if necessary and returned by
CommandRunner.runCommand
.
Implementation
@override
FutureOr<void> run() async {
final tag = (argResults!['tag'] as String).toLowerCase();
final image = EventStoreImage.images.firstWhere(
(e) => tag == e.tag.toLowerCase(),
orElse: () => EventStoreImage.LTS,
);
stdout.writeln("Running esdbtcli $name on ${image.tag}...");
final server = EventStoreServerSingleNode(
image,
secure: argResults!['secure'] as bool,
hostCertificatePath: argResults!['certs'] as String,
);
await server.start(
verbose: true,
name: argResults!['name'] as String,
);
stdout.writeln(
"EventStoreDB in docker container '${argResults!['name']}' is running",
);
// HACK: Unsure why this hangs when starting with --secure
exit(0);
}