Skip to content

Use description file for execution tasks in project #21

@sleipnir

Description

@sleipnir

The CLI offers many important command options and arguments that manage, or should manage, the entire development cycle of a cloudstate serveless function. Beautiful.
But I see that it would be interesting to offer an extra option for the user. There could be a properties file, probably toml or yaml, where we could describe all the parameters of a function app.
This would allow for much faster workflows because, imagine that we created a file that described everything we need and executed a "cloudstate init" command in the folder where that file is located? As a result, the entire project structure would be created, as well as specific Cloudstate Operator configurations.
So far nothing new, but let's move forward a little and imagine that we would execute any other command that required many parameters in the traditional way (cloudstate deploy for example). In this case, the CLI would only read the information from the descriptor file and execute all the necessary steps without the user having to execute the command with all parameters every time he needed to carry out this command.
This would also allow us to add new features as an extension of the CLI, such as creating clusters in different cloud providers, without this polluting the set of options available via the command line.

File proposal for toml(.cloudsettings):

[function]
name = "shopping-cart"
profile = "java"
tag = "0.4.2"
authors = ["Adriano Santos <sleipnir@bsd.com.br>"]
namespace = "production"
datastore-name = "my-postgres-store"

[provisioning]
operator-ns = "cloudstate"
operator-watch-ns = ["production", "qa", "dev"]
operator-proxy-image-postgress = "cloudstateio/cloudstate-proxy-postgress:0.4.3"
orchestrator = "kubernetes"
provider-name = "aks"

[datastore]
name = "my-postgres-store"
type = "Postgres"
deployment = "Unmanaged"
service = "postgresql.default.svc.cluster.local"
credentials-secret = "postgres-credentials"

[provider]
name = "aks"
resource-group = "MC_my_resource_group_eastus"
cluster-name = "my-aks-cluster-name"
cluster-nodes-size = "3"
create-if-not-exist = "true"

[registry]
url = "docker.io/sleipnir"
credentials-type = "file"
credentials-file = ".credentials"

[general]
default-editor = "idea"
....

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions