Closed haoliangyu closed 4 years ago
ping @dmfenton @rgwozdz for comments
This seems like a very good approach! Looking forward to seeing the PR.
Close the proposal for now because the deployment is out of scope. We should guide the Koop developers to use the native tool provided by the cloud service provider.
This issue is to discuss the
deploy
command and the deployer. More content is to add.deploy command
This proposed command is to automate the Koop application deployment to a given cloud platform.
When used, the command reads
koop.json
, the CLI configuration, at the current Koop application project and check if the project's deployer is specified.The
deployer
property refers to the name of a standalone Koop deployer module, which includes the actual logic of the deployment.Alternatively, a js file path can be specified if a custom deployment is needed.
If the deployer is not specified, the command will throw an deployer undefined error.
If the deployer is specified, the deployer will be loaded and deploy the application with any given arguments.
The
deploy
command is actually a runner of any given deployer. This provides many advantages:Psedocode of the
src/commands/deploy.js
:Deployer
A deployer is a separate nodejs module that exports a yargs command module. It is the actual implementation of the
deploy
command for a specific platform.An example:
How to use
The Koop CLI and the deployer module must be installed as global packages or the project's dev dependencies at the same time. Once the user specifies the
deployer
at the project'skoop.json
, he can use thekoop deploy
command for the app.Plan
deploy
commandnew
command to create a new deployer projectadd
command to add a deployer to the current Koop appv0.3.0