fresh-yak-35965
07/18/2024, 10:42 PMyaml
---
kind: Run
type: exec
name: setup-remote-nodes
description: Setup remote nodes for dev FM API client
dependencies:
- build.fm-api-mock-server
- build.fm-api-mock-client
spec:
command:
- /bin/bash
- scripts/download-image.sh
- --cluster
- "${var.cluster}"
- --ssh-key
- "${var.sshkey}"
- --image
- ${actions.build.fm-api-mock-client.outputs.deploymentImageId}
- --socket-host
- wss://fm-api-${actions.deploy.fm-api-mock-server.var.apphost}/api/v1/ws
microscopic-river-74022
07/18/2024, 10:42 PMmicroscopic-river-74022
07/18/2024, 10:42 PMspec.cacheResult: false
in the Run definition. This will prevent Garden from caching the result of the Run, and it will always execute the Run regardless of previous results.
Here is how you can modify your Run definition:
yaml
---
kind: Run
type: exec
name: setup-remote-nodes
description: Setup remote nodes for dev FM API client
dependencies:
- build.fm-api-mock-server
- build.fm-api-mock-client
spec:
cacheResult: false
command:
- /bin/bash
- scripts/download-image.sh
- --cluster
- "${var.cluster}"
- --ssh-key
- "${var.sshkey}"
- --image
- ${actions.build.fm-api-mock-client.outputs.deploymentImageId}
- --socket-host
- wss://fm-api-${actions.deploy.fm-api-mock-server.var.apphost}/api/v1/ws
You can also manually run the Run using the command garden run <run-name>
, which will run the Run even if the result is cached.
Source: Garden FAQ ()
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
07/18/2024, 10:42 PMfresh-yak-35965
07/18/2024, 11:07 PMmicroscopic-river-74022
07/18/2024, 11:07 PMmicroscopic-river-74022
07/18/2024, 11:07 PMexec
provider's initScript
configuration. This allows you to run an arbitrary script when initializing providers. You can specify your Run command in this script.
Here's an example of how you can configure it in your project level Garden config file:
yaml
# In your project level Garden config file
apiVersion: garden.io/v1
kind: Project
name: my-project
providers:
- name: exec
initScript: "/bin/bash scripts/download-image.sh --cluster ${var.cluster} --ssh-key ${var.sshkey} --image ${actions.build.fm-api-mock-client.outputs.deploymentImageId} --socket-host wss://fm-api-${actions.deploy.fm-api-mock-server.var.apphost}/api/v1/ws"
# ...
In this configuration, the initScript
will run every time Garden is started, regardless of the dependencies of other Garden objects.
Please note that the initScript
is run in the project root when initializing providers.
Source: Garden Exec Plugin () and Exec Provider Configuration ()
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
07/18/2024, 11:07 PMfresh-yak-35965
07/18/2024, 11:08 PMcacheResult
, because currently, garden is not even executing this:
yaml
---
kind: Run
type: exec
name: setup-remote-nodes
description: Setup remote nodes for dev FM API client
dependencies:
- build.fm-api-mock-server
- build.fm-api-mock-client
spec:
cacheResult: false
command:
- /bin/bash
- scripts/download-image.sh
- --cluster
- "${var.cluster}"
- --ssh-key
- "${var.sshkey}"
- --image
- ${actions.build.fm-api-mock-client.outputs.deploymentImageId}
- --socket-host
- wss://fm-api-${actions.deploy.fm-api-mock-server.var.apphost}/api/v1/ws
microscopic-river-74022
07/18/2024, 11:08 PMmicroscopic-river-74022
07/18/2024, 11:09 PMexec
provider's initScript
configuration. This allows you to run an arbitrary script when initializing providers. You can specify your Run command in this script.
Here's an example of how you can configure it in your project level Garden config file:
yaml
# In your project level Garden config file
apiVersion: garden.io/v1
kind: Project
name: my-project
providers:
- name: exec
initScript: "/bin/bash scripts/download-image.sh --cluster ${var.cluster} --ssh-key ${var.sshkey} --image ${actions.build.fm-api-mock-client.outputs.deploymentImageId} --socket-host wss://fm-api-${actions.deploy.fm-api-mock-server.var.apphost}/api/v1/ws"
# ...
In this configuration, the initScript
will run every time Garden is started, regardless of the dependencies of other Garden objects.
Please note that the initScript
is run in the project root when initializing providers.
Source: Garden Exec Plugin () and Exec Provider Configuration ()
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
07/18/2024, 11:09 PM