gentle-umbrella-55872
05/01/2024, 12:15 PMmicroscopic-river-74022
05/01/2024, 12:16 PMmicroscopic-river-74022
05/01/2024, 12:16 PM*.garden.yml
). You can specify dependencies between services, allowing you to control the order in which services are started. For example, in the frontend/frontend.garden.yml
file, the backend
deployment is specified as a dependency, which makes the database (mongo
) an indirect dependency. This means that when you start the frontend
service, the backend
and mongo
services will also be started if they are not already running.
yaml
kind: Deploy
apiVersion: garden.io/v1
name: frontend
description: The frontend server and UI components container
type: container
dependencies:
- build.frontend
- deploy.backend
spec:
image: ${actions.build.frontend.outputs.deploymentImageId}
env:
DANGEROUSLY_DISABLE_HOST_CHECK: true
sync:
paths:
- source: ./src
target: /usr/src/app/src
mode: "one-way-replica"
ports:
- name: http
containerPort: 3000
healthCheck:
httpGet:
path: /
port: http
ingresses:
- path: /
port: http
Source ()
Additionally, you can define custom commands in Garden, which can be used to start a specific subset of services. Custom commands are defined in a Garden project and can include any number of actions, such as starting specific services, running tests, or deploying infrastructure. These commands can be run using the garden
CLI, making it easy to start a specific subset of services.microscopic-river-74022
05/01/2024, 12:16 PMyaml
kind: Command
name: api-dev
description:
short: Start garden with preconfigured options for API development
exec:
command:
- sh
- -c
- git submodule update --recursive --remote # Because we keep forgetting to update these, amirite?
gardenCommand:
- deploy
- --sync
- api,worker
- --log-level
- debug
- $concat: ${args.$all} # Allow any arguments/options on top of the fixed ones above
Source ()
In this example, the api-dev
command starts the api
and worker
services. You can define similar commands for other subsets of services in your monorepo.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------gentle-umbrella-55872
05/01/2024, 12:31 PM