Feature: Run `sls dynamodb start` in detached modeSee original GitHub issue
For CI testing, one would need to run
sls dynamodb start asynchronously, because the command blocks the current shell.
sls dynamodb start &
This runs it in the background, but does not wait until the db is set up properly.
sls dynamodb start & sleep 5
This works, but might introduce race conditions.
sls dynamodb start --detached which runs synchronously until all work is done, exits the process (the shell command is finished), but continues serving the database in the background.
- Created 6 years ago
Top GitHub Comments
https://github.com/doapp-ryanp/dynamodb-local/pull/19 I managed to find the very base NPM package of this build, and got it to run in detached mode (albeit with async wrapping).
As such, this should be possible for the serverless plugin to work in this way.
Ideally I want to run in my DevOps pipeline:
sls dynamodb start --seed=test --detached
which would just start the whole database (potentially writing the child object, or child pid) to a temp file.
And kill the whole thing with
sls dynamodb stop. Even if this requires under the hood asyncing.
This is heavily blocking proper CI/CD & DevOps usage of the whole tool tbh.
Nobody in their right mind can go into a pipeline and say: “run all this, then do your test, oh and then press ctrl+c when you’re done”.
It is an underlying issue with
dynamodb-local which this plugin straight up uses, copies, and adds bit of functionality to.
Ideally I wish to be able to dive into my npm script, start the database detached, run my tests, kill the database.