If you’re comfortable with more dirty hands try mxbuild: https://docs.mendix.com/refguide/mxbuild
Have a look at the Deploy APIs, you should be able to wrap these calls to do what you need.
https://docs.mendix.com/apidocs-mxsdk/apidocs/deploy-api
https://docs.mendix.com/apidocs-mxsdk/apidocs/deploy-api-2
Hope this helps.