plain-pizza-51556
10/01/2024, 12:06 PMmicroscopic-river-74022
10/01/2024, 12:06 PMmicroscopic-river-74022
10/01/2024, 12:06 PM.garden/artifacts
directory. This can be done by using the artifacts
field in your test configuration.
Here is an example of how you can specify artifacts in a test configuration:
yaml
kind: Test
type: container
name: my-test
...
spec:
command: [some, command]
artifacts:
- source: /report/*
target: my-test-report
In this example, after running my-test
, you can find the contents of the report
directory in the test's container, locally under .garden/artifacts/my-test-report
.
Please note that the target
field is a POSIX-style path to copy the artifacts to, relative to the project artifacts directory at .garden/artifacts
.
For more information, you can refer to the Garden documentation on Test Artifacts () and the specific module type references for container (), kubernetes (), and helm ().
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
10/01/2024, 12:06 PMplain-pizza-51556
10/01/2024, 12:09 PMmicroscopic-river-74022
10/01/2024, 12:09 PMmicroscopic-river-74022
10/01/2024, 12:10 PMgarden deploy
. However, the exact method can vary depending on the type of artifact and how your services are set up.
If the artifact is a part of your codebase, you can include it in your Dockerfile or in the include
field of your module configuration. Then, when you run garden deploy
, Garden will build your services and include the artifact in the build context.
Here's an example of how you might include an artifact in a Dockerfile:
Dockerfile
FROM node:12
WORKDIR /app
COPY . .
COPY path/to/your/artifact /desired/location/in/container
CMD ["node", "index.js"]
And here's how you might include it in a module configuration:
yaml
kind: Module
type: container
name: my-module
include:
- path/to/your/artifact
services:
- name: my-service
...
In these examples, replace path/to/your/artifact
with the path to your artifact, and /desired/location/in/container
with where you want the artifact to be in the container.
If the artifact is not part of your codebase, or if you need to fetch it from an external source as part of your deployment process, you might need to use a task () or a script () to fetch the artifact and place it in the right location.
Please note that these are general guidelines and the exact method can depend on your specific use case and setup. For more detailed instructions, you can refer to the Garden documentation ().
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
10/01/2024, 12:10 PMplain-pizza-51556
10/01/2024, 12:12 PMmicroscopic-river-74022
10/01/2024, 12:12 PMmicroscopic-river-74022
10/01/2024, 12:12 PMgarden deploy
command.
Here's a simple example of how you might do this in a bash script:
bash
if [ -f ".garden/artifacts/my-test-report" ]; then
garden deploy
else
echo "Artifact does not exist, skipping deployment"
fi
In this script, replace .garden/artifacts/my-test-report
with the path to your artifact. This script checks if the artifact exists, and if it does, it runs garden deploy
. If the artifact does not exist, it prints a message and skips the deployment.
Please note that this is a simple example and you might need to adjust it based on your specific use case and environment. For more information on how to use Garden, you can refer to the Garden documentation ().
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
10/01/2024, 12:12 PMplain-pizza-51556
10/01/2024, 12:14 PMdisabled
field of deploy containermicroscopic-river-74022
10/01/2024, 12:14 PMmicroscopic-river-74022
10/01/2024, 12:14 PM${actions.test.<name>.outputs.log}
template string. This will give you the full log output from the executed test action.
Here's an example of how you might use this in a configuration file:
yaml
kind: Module
type: container
name: my-module
services:
- name: my-service
args: ["${actions.test.my-test.outputs.log}"]
...
In this example, replace my-test
with the name of your test action. This will pass the log output of the test action as an argument to the service.
As for the disabled
field, you can use it to disable a deploy action. You can set this field to true
to disable the action, and you can use it with conditional template strings to disable actions based on certain conditions.
Here's an example of how you might use the disabled
field:
yaml
kind: Module
type: container
name: my-module
services:
- name: my-service
disabled: ${environment.name == "prod"}
...
In this example, the service will be disabled if the current environment is prod
.
Please note that these are general examples and you might need to adjust them based on your specific use case and setup. For more detailed instructions, you can refer to the Garden documentation ().
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
10/01/2024, 12:14 PMplain-pizza-51556
10/01/2024, 12:27 PMmicroscopic-river-74022
10/01/2024, 12:27 PMmicroscopic-river-74022
10/01/2024, 12:27 PMsuccess
field. If the action was successfully executed, success
will be true
. If the action failed, success
will be false
.
Here's an example of how you might access this in a configuration file:
yaml
kind: Module
type: container
name: my-module
services:
- name: my-service
args: ["${{actions.test.my-test.outputs.success}}"]
...
In this example, replace my-test
with the name of your test action. This will pass the success status of the test action as an argument to the service.
For more detailed instructions, you can refer to the Garden documentation ().
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
10/01/2024, 12:27 PM