This is a work-in-progress!
Tool for building and deploying microservices within a monorepo.
orcs init {project}
: Create a new projectorcs new service {service}
: Create a new serviceorcs new recipe {recipe}
: Create a new recipeorcs run all
: Run all services in all stagesorcs run {stage}
: Run all services for a specific stageorcs run all {service}
: Run all stages for a specific serviceorcs run {stage} {service}
: Run a specific stage for a specific serviceorcs get {parameter}
: Retrieve a parameter valueorcs get-file {parameter} {filename}
: Retrieve an artifact fileorcs set {parameter} {value}
: Set a parameter valueorcs set-file {parameter} {filename}
: Store an artifact fileThe actions are the list of commands to perform for a specific service and stage.
Stages also support check actions, which are meant to be fast and return an error if the stage should be run again for that particular service.
A parameter is a value provided by a service as a result of its actions.
Parameters could be simple values, such as an API endpoint URL, or files such as zipped libraries, etc.
A project represent a repository containing multiple services, recipes, etc.
A recipe is a series of default actions that can be used by services.
For example, if many services use the same programming language, you may want to create a recipe for linting, building, testing services that use that language.
A service represent either a microservice or a shared library used by other microservices.
Services can have dependencies between each other, and those dependencies may vary based on the stage. For example, it might be possible to build two microservices at the same time, but one needs to wait until the other one is updated.
A stage is a step within the entire workflow of the project.
A simple workflow typically consists of two stages: build and deploy. Within a service, a stage will consists of a series of actions to take to perform the desired action related to that stage. For example, building a library or deploying a microservice.
Stages can depend on each other, thus allowing complex workflows.
Stages can also be skipped during a complete run, for example if this is a clean up stage.
A project file is the orcs.toml
file at the root of the project and is comprised of three main sections: global, envs and stages.
```toml [global.params]
project = "my-project"
[envs.dev] params.is-prod = "false"
[envs.prod] params.is-prod = "true"
[stages.build]
[stages.deploy]
depends_on = ["build"]
params.target = "linux"
envs = ["dev", "prod"] ```
A service file is an orcs.toml
file in a given service folder containing all the instructions and metadata about a service.
```toml
description = """API to returns a string backwards
..."""
maintainers = [ "John Doe john.doe@company.example" ]
homepage = "https://wiki.company.example/my-service"
recipes = [ "python" ]
[stages.build] depends_on = []
actions = [ "echo Hello from $ORCS_SERVICE", # You can use 'orcs set' and 'orcs get' within a list of actions to set and # retrieve parameter values. "orcs set my-parameter:value" ]
#
check = "false"
[stages.deploy] depends_on = []
actions = false
check = "false" ```
Recipe files are TOML files in the rcp
folder of the project and only support stages sections. Within these sections, you can define default actions and checks for common use-cases.
Only actions and check are supported within recipe files.
```toml [stages.build] actions = [ "echo Hello from a recipe" ]
check = [ "echo Check if the stage needs to be built" ]
[stages.deploy] actions = [ "echo Hello from a recipe" ] ```