Open
Description
Description
This is the documentation for the command. Read through it to understand what is the purpose of vrealize:clean
.
This is how vrealize:clean can be called:
mvn vrealize:clean -DincludeDependencies=true -DcleanUpOldVersions=true -DcleanUpLastVersion=false -PDevLab
mvn vrealize:clean -DincludeDependencies=true -DcleanUpOldVersions=false -DcleanUpLastVersion=true -PDevLab
The problem is that currently it doesn't work as expected. There are actually a few issues here:
- You can't do
cleanupOldVersions
andcleanUpLastVersion
at the same time due to a bug - You can't clean up last version in some cases...
- if
all.size === 0
we are all good, cause it deletes thelatest
package that waspollLast
-ed before... - if not, we attempt to delete the previous iteration, not the latest. This is perhaps to safeguard against deleting everything on the environment, but vrealize:clean ought to be used to actually delete the latest when you want to do that.
- There is a case where the environment does not get fully cleaned up, perhaps a dependency of a dependency or even deeper down. Investigate this
Proposed solutions
Delete old packages
- Fetch package, package dependencies and their dependencies and so on and so forth (up for discussion, could only go one level down?)
- Search for them in vro
- Whatever is found out, should be deleted with
deletePackageVersion
, aka deleting the package and any obsolete/deprecated/left over code.
Cleanup Environment
This will be essentially delete latest and old at the same time
- Fetch package, package dependencies and their dependencies and so on and so forth (up for discussion, could only go one level down?)
- Search for them in vro
- Delete them with their content and all old versions.