We have a few containers running in AWS ECS (EC2 based) and we use a custom cli built with oclif to connect with those containers from local systems. Currently I am coding the functionality to run migration and after party task in the container using oclif. Below is the code snippet for these commands
migrate: flags.boolean({
char: 'm',
default: 'rake db:migrate',
description: 'Execute migrations in the gemstone console',
}),
tasks: flags.boolean({
char: 't',
default: 'rake after_party:run',
description: 'Run after_party tasks in the gemstone console',
}),
The only issue I am having is due to a requirement to keep the shell open after running these tasks (if the user wants). So I tried to create another flag for that but dont know what the command to use to keep the shell open.
shell: flags.boolean({
char: 's',
default: <command to keep shell open>,
description: 'Keep shell open after running task/migrations',
}),
So for example if a user runs the below command, then the command should run the migration task and then keep the shell open. (Assume connect is the custom cli keyword that is used to connect the containers and handle all ssh/connectivity stuff). Any idea how it will work? Thanks
connect <containerName> -m -s