fix(cli): do not remove persistent storage by default in ExApp unregister command (#381)

Do not remove ExApp docker volume by default, deprecate old option
`keep-data`, add new `rm-data` to remove ExApp data.

---------

Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
This commit is contained in:
Andrey Borysenko
2024-09-06 21:09:54 +03:00
committed by GitHub
parent 9a49b1c0da
commit 2ef33a042f
4 changed files with 13 additions and 11 deletions

View File

@ -65,14 +65,14 @@ if __name__ == "__main__":
r = run("php occ --no-warnings app_api:app:unregister skeleton".split(), stdout=PIPE)
assert r.returncode
assert r.stdout.decode("UTF-8"), "Output should be non empty"
# testing if "--keep-data" works.
# testing if volume is kept by default
deploy_register()
r = run("php occ --no-warnings app_api:app:unregister skeleton --keep-data".split(), stdout=PIPE, check=True)
r = run("php occ --no-warnings app_api:app:unregister skeleton".split(), stdout=PIPE, check=True)
assert r.stdout.decode("UTF-8"), "Output should be non empty"
run("docker volume inspect nc_app_skeleton_data".split(), check=True)
# test if volume will be removed without "--keep-data"
# test if volume will be removed with "--rm-data"
deploy_register()
run("php occ --no-warnings app_api:app:unregister skeleton".split(), check=True)
run("php occ --no-warnings app_api:app:unregister skeleton --rm-data".split(), check=True)
r = run("docker volume inspect nc_app_skeleton_data".split())
assert r.returncode
# test "--force" option