Open everestx opened 8 years ago
I agree. We may have to move the app types from json files to python files. Doing that is not to difficult and it allows inheritance using the python model.
class BaseAppType(object)
class RubyType(BaseAppType)
class RubyAPIType(RubyType)
ect..
Doing it this way we could add more customization for app types. Like doing similar tasks depending on environment.
That's a good idea. I'll work in this direction and see what I can come up with. Would you expect to support both json and/or schematics models?
In working with this framework, I'm finding that inheritance among types would be very helpful. For instance, we have some 3 or 4 very similar apptypes that deviate slightly in each of the task and/or configuration steps.
All of these app types are very similar in the stage operation: git clone, bundler, tarball and upload. However, each have a slight deviation in either the stage or deploy tasks (ex:
deploy_path
orrake assets:precompile
)This of course is still all possible when creating a stage/deploy using
-f app.json
options in the CLI, but I'm really apt to prevent apps from specifying any custom tasks that could ultimately be shared.Adding this inheritance would allow different app-types that inherit from parent app-types. As an example Ruby could be the parent or super type. Ruby would then be barebones for stage and deploy: git clone, bundle, tarball, upload.
To get started, we could create a method to manage the read of the apptypes and handle the inheritance and deep merge of the json structure. This could be recursive to allow multiple layers of inheritance, using an
app_type
orparent_type
key in each of the json structures.