### Clone Example Project Source: https://github.com/garden-io/garden/blob/main/docs/getting-started/quickstart.md Clone the Garden quickstart example project from GitHub and navigate into the project directory. ```sh git clone https://github.com/garden-io/quickstart-example.git cd quickstart-example ``` -------------------------------- ### Garden CLI: Get Users Examples Source: https://github.com/garden-io/garden/blob/main/docs/reference/commands.md Examples for listing users in a Garden Cloud organization. Use `--output json` for scripting. ```bash garden get users # list users and pretty print results garden get users --current-user # show only the current user garden get users --output json # returns users as a JSON object, useful for scripting ``` -------------------------------- ### Start Development with Garden Source: https://github.com/garden-io/garden/blob/main/docs/misc/adopting-garden.md Initiate a development environment by cloning the project repository and running `garden dev`. This command automates the setup of a remote, production-like environment. ```console garden dev ``` -------------------------------- ### Garden CLI: Get Variable Lists Examples Source: https://github.com/garden-io/garden/blob/main/docs/reference/commands.md Examples for listing variable lists in a Garden Cloud organization. Use `--output json` for scripting. ```bash garden get variable-lists # list variable lists and pretty print results garden get variable-lists --output json # returns variable lists as a JSON object, useful for scripting ``` -------------------------------- ### Clone Example Application Source: https://github.com/garden-io/garden/blob/main/docs/tutorials/your-first-project/1-initialize-a-project.md Clone the example web application repository and checkout the tutorial branch to begin. ```sh git clone https://github.com/garden-io/web-app-example.git cd web-app-example git checkout tutorial-start ``` -------------------------------- ### Example: `jib` Provider Dependencies Configuration Source: https://github.com/garden-io/garden/blob/main/docs/reference/providers/jib.md Example showing how to list other providers that should be resolved before this one. This ensures proper ordering of provider initialization. ```yaml providers: - dependencies: - exec ``` -------------------------------- ### Install Garden CLI on Linux Source: https://github.com/garden-io/garden/blob/main/docs/getting-started/quickstart.md Download and execute the installation script to install the Garden CLI on Linux. ```sh curl -sL https://get.garden.io/install.sh | bash ``` -------------------------------- ### Garden CLI: Get Remote Variables Examples Source: https://github.com/garden-io/garden/blob/main/docs/reference/commands.md Examples for listing remote variables from Garden Cloud. Use `--output json` for scripting. ```bash garden get remote-variables # list remote variables and pretty print results garden get remote-variables --output json # returns remote variables as a JSON object, useful for scripting ``` -------------------------------- ### Example: `jib` Provider Environments Configuration Source: https://github.com/garden-io/garden/blob/main/docs/reference/providers/jib.md Example illustrating how to specify the environments in which this provider should be used. An empty array effectively disables the provider. ```yaml providers: - environments: - dev - stage ``` -------------------------------- ### Setup AEC for Local Kubernetes Development Source: https://github.com/garden-io/garden/blob/main/docs/contributing/README.md Execute this command from an example project directory to set up the AEC feature for local Kubernetes development. ```sh garden plugins local-kubernetes setup-aec -- --local-dev ``` -------------------------------- ### Project and Environment Variables Example Source: https://github.com/garden-io/garden/blob/main/docs/features/variables-and-templating.md Example demonstrating project-level variables and environment-specific varfiles for overriding values like log level and database password. ```yaml # garden.yml apiVersion: garden.io/v2 kind: Project ... variables: LOG_LEVEL: debug environments: - name: local ... - name: remote ... ``` ```plain # garden.remote.env log-level=info database-password=fuin23liu54at90hiongl3g ``` ```yaml # my-service/garden.yml kind: Deploy spec: env: LOG_LEVEL: ${var.log-level} DATABASE_PASSWORD: ${var.database-password} ``` -------------------------------- ### Example `container` action configuration Source: https://github.com/garden-io/garden/blob/main/docs/reference/action-types/Test/container.md This example demonstrates how to configure a `container` action, including its source repository and dependencies. Ensure the `source.repository.url` points to a valid git repository with a branch or tag. ```yaml source: ... repository: ... url: "git+https://github.com/org/repo.git#v2.0" ``` ```yaml dependencies: - build.my-image - deploy.api ``` -------------------------------- ### Example Build Context Output Source: https://github.com/garden-io/garden/blob/main/examples/build-dependencies/README.md This is an example of the output from the `tree` command, showing the `.garden/build/frontend` directory structure. It highlights the `config/config.json` file, which was copied from the `shared-config` build action. ```text .garden/build/frontend ├── config │ └── config.json # <--- The shared config file ├── Dockerfile ├── app.js ├── ... ``` -------------------------------- ### Install Git on Ubuntu Source: https://github.com/garden-io/garden/blob/main/docs/guides/installation.md Installs Git on Ubuntu using the apt package manager. ```sh sudo apt install git ``` -------------------------------- ### Example: `jib` Provider Name Configuration Source: https://github.com/garden-io/garden/blob/main/docs/reference/providers/jib.md Example demonstrating how to specify the name of the provider plugin to use. This is a required field for the provider. ```yaml providers: - name: "local-kubernetes" ``` -------------------------------- ### garden sync start Source: https://github.com/garden-io/garden/blob/main/docs/reference/commands.md Start syncing your local project directory with one or more Deploys. Can optionally deploy the actions if they are not already deployed in sync mode. ```APIDOC ## garden sync start ### Description Start any configured syncs to the given Deploy action(s). ### Method Not applicable (CLI command) ### Endpoint Not applicable (CLI command) ### Parameters #### Arguments - **names** (string) - Optional - The name(s) of one or more Deploy(s) (or services if using modules) to sync. You may specify multiple names, separated by spaces. To start all possible syncs, specify '*' as an argument. #### Options - **--deploy** (boolean) - Optional - Deploy the specified actions, if they're out of date and/or not deployed in sync mode. - **--with-dependencies** (boolean) - Optional - When deploying actions, also include any runtime dependencies. Ignored if --deploy is not set. - **--monitor** (boolean) - Optional - Keep the process running and print sync status logs after starting them. ### Request Example ```bash garden sync start api garden sync start --deploy garden sync start * ngarden sync start api worker -f ``` ### Response Not applicable (CLI command output) ### Error Handling Not applicable (CLI command output) ``` -------------------------------- ### Start Sync to All Deploys with Deployment and Dependencies Source: https://github.com/garden-io/garden/blob/main/docs/reference/commands.md Starts sync operations to all Deploy actions, deploying them if needed and including their runtime dependencies. This ensures all necessary components are synchronized. ```bash garden sync start --deploy --include-dependencies ``` -------------------------------- ### Install Frontend Dependencies Source: https://github.com/garden-io/garden/blob/main/examples/local-service/README.md Installs the necessary npm packages for the frontend project. This command should be run from the 'frontend' directory. ```bash cd frontend npm install cd .. ``` -------------------------------- ### Install Garden CLI Source: https://context7.com/garden-io/garden/llms.txt Install the Garden CLI using package managers or a script. Choose the appropriate command for your operating system. ```bash # macOS brew install garden-io/garden/garden-cli ``` ```bash # Linux curl -sL https://get.garden.io/install.sh | bash ``` ```powershell # Windows (PowerShell as administrator) Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/garden-io/garden/master/support/install.ps1')) ``` -------------------------------- ### Copy Vote Example and Remove Configuration Source: https://github.com/garden-io/garden/blob/main/core/test/data/openshift/demo-project/README.md Use these bash commands to copy the 'vote' example project and remove its default configuration before adapting it for OpenShift. ```bash cp -r ../../../../../examples/vote/ vote/ rm vote/garden.yml ``` -------------------------------- ### Example Docker Hub config.json structure Source: https://github.com/garden-io/garden/blob/main/docs/tutorials/remote-k8s/configure-registry/docker-hub.md This is an example of the structure of the `config.json` file, showing the `auths` section with an authorization token for Docker Hub. ```json { "auths": { "https://index.docker.io/v1/": { "auth": "c3R...zE2" } } } ``` -------------------------------- ### Deploy and Start Sync to a Deploy Action Source: https://github.com/garden-io/garden/blob/main/docs/reference/commands.md Deploys the specified action if it's not already deployed in sync mode, and then starts syncing. This is useful for ensuring the target is ready before syncing. ```bash garden sync start api --deploy ``` -------------------------------- ### Install Frontend Dependencies Source: https://github.com/garden-io/garden/blob/main/examples/local-volume-mounts/README.md Before deploying, install frontend dependencies locally. This is necessary because the volume mount overlays the container's `/app` directory with your local `frontend/` directory, requiring `node_modules` to exist locally. ```bash cd frontend && npm install && cd .. ``` -------------------------------- ### Terraform Backend Configuration Example Source: https://github.com/garden-io/garden/blob/main/docs/garden-for/terraform/actions.md Example of a Terraform backend configuration block, demonstrating how to specify the S3 backend with placeholder values for bucket and key that can be dynamically set. ```hcl terraform { required_version = ">= 0.12" backend "s3" { bucket = "" key = "" region = "" } } # ... ``` -------------------------------- ### Start Sync to All Deploys Source: https://github.com/garden-io/garden/blob/main/docs/reference/commands.md Starts sync operations to all Deploy actions that are currently deployed in sync mode. This is a convenient way to sync multiple services simultaneously. ```bash garden sync start ``` -------------------------------- ### Basic AEC Configuration Example Source: https://github.com/garden-io/garden/blob/main/docs/garden-for/kubernetes/automatic-environment-cleanup.md Example of basic AEC configuration in `project.garden.yml` or `garden.yml` to pause after 1 day and cleanup after 7 days of inactivity. ```yaml kind: Project name: my-project environments: - name: preview aec: triggers: - action: pause timeAfterLastUpdate: value: 1 unit: days - action: cleanup timeAfterLastUpdate: value: 7 unit: days ``` -------------------------------- ### Start Sync to All Deploys with Deployment Source: https://github.com/garden-io/garden/blob/main/docs/reference/commands.md Starts sync operations to all Deploy actions that support it, deploying them if necessary. This command ensures all relevant Deploys are active and ready for syncing. ```bash garden sync start '*' --deploy ``` -------------------------------- ### New Pulumi Varfile Schema Example Source: https://github.com/garden-io/garden/blob/main/docs/garden-for/pulumi/README.md This example demonstrates the updated Pulumi varfile schema. Configuration values are now nested under the 'config' key, allowing for other top-level settings such as 'secretsprovider'. ```yaml secretsprovider: gcpkms://projects/xyz/locations/global/keyRings/pulumi/cryptoKeys/pulumi-secrets encryptedkey: 123456 config: kubernetes:context: orbstack pulumi-k8s:namespace: ns-from-the-varfile ``` -------------------------------- ### Install Garden CLI on Windows Source: https://github.com/garden-io/garden/blob/main/docs/getting-started/quickstart.md Install the Garden CLI on Windows using PowerShell. It's recommended to add an exclusion for the .garden directory in your repository root to Windows Defender for performance improvements. ```PowerShell Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/garden-io/garden/master/support/install.ps1')) ``` ```PowerShell Add-MpPreference -ExclusionPath "C:\Path\To\Your\Repo\.garden" ``` -------------------------------- ### Setup Ingress Controller Source: https://github.com/garden-io/garden/blob/main/docs/reference/providers/local-kubernetes.md Configure the installation of an ingress controller. ```APIDOC ## providers[].setupIngressController ### Description Set this to `nginx` or `traefik` to install the respective ingress controller, or to `null`/`false` to skip. The nginx controller is deprecated and will be removed in a future version — we recommend switching to `traefik`. ### Parameters #### Request Body - **setupIngressController** (string) - Optional - Defaults to `"nginx"`. Set to `"nginx"` or `"traefik"` to install the respective ingress controller, or to `null`/`false` to skip. ``` -------------------------------- ### Garden Deploy with Options Source: https://github.com/garden-io/garden/blob/main/docs/reference/commands.md Examples demonstrating the use of various options with the 'garden deploy' command. ```bash garden deploy --force # force re-deploy, even for deploys already deployed and up-to-date ``` ```bash garden deploy --sync=my-deploy # deploys all Deploys, with sync enabled for my-deploy ``` ```bash garden deploy --sync # deploys all compatible Deploys with sync enabled ``` ```bash garden deploy --env stage # deploy your Deploys to an environment called stage ``` ```bash garden deploy --skip deploy-b # deploy everything except deploy-b ``` ```bash garden deploy --forward # deploy everything and start port forwards without sync or local mode ``` ```bash garden deploy my-deploy --logs # deploy my-deploy and follow the log output from the deployed service ``` ```bash garden deploy my-deploy -l 3 # deploy with verbose log level to see logs of the creation of the deployment ``` ```bash garden deploy --plan # show what would be deployed without making any changes ``` ```bash garden deploy my-deploy --plan # show what deploying my-deploy would do ``` -------------------------------- ### Create Working Directory Source: https://github.com/garden-io/garden/blob/main/examples/kustomize/helloWorld/README.md Sets up a temporary directory for the demo. Use this for automated tests. ```bash DEMO_HOME=$(mktemp -d) ``` -------------------------------- ### Update Garden CLI to Latest Major Version Source: https://github.com/garden-io/garden/blob/main/docs/reference/commands.md Installs the latest major version of the Garden CLI, even if it represents a significant change from the current version. This option ensures you get the newest major release. ```bash garden self-update --major ``` -------------------------------- ### Create Working Directory Source: https://github.com/garden-io/garden/blob/main/e2e/projects/kustomize-modules/helloWorld/README.md Sets up a temporary directory for the demo. Alternatively, a persistent directory can be used. ```bash DEMO_HOME=$(mktemp -d) ``` ```bash DEMO_HOME=~/hello ``` -------------------------------- ### Install macOS Dependencies Source: https://github.com/garden-io/garden/blob/main/docs/contributing/garden-dev-env-setup.md This script installs all required dependencies for developing on macOS. Ensure Homebrew is installed first. ```sh ./scripts/install-osx-dependencies.sh ``` -------------------------------- ### Install ArgoCD using Helm Source: https://github.com/garden-io/garden/blob/main/examples/argocd/README.md Installs ArgoCD on the production cluster using Helm. Ensure Helm repositories are updated before installation. ```bash helm repo add argo https://argoproj.github.io/argo-helm helm repo update helm -n argocd install argocd argo/argo-cd --version 5.13.5 --create-namespace ``` -------------------------------- ### Install Ingress Controller Source: https://github.com/garden-io/garden/blob/main/docs/reference/providers/local-kubernetes.md Configure `setupIngressController` to install either `nginx` or `traefik`. `nginx` is deprecated; `traefik` is recommended. Set to `null` or `false` to skip installation. ```yaml providers: - setupIngressController: "nginx" ``` -------------------------------- ### Manually Start minikube Mount Source: https://github.com/garden-io/garden/blob/main/docs/garden-for/kubernetes/local-volume-mounts.md If Garden cannot automatically start the `minikube mount` command, you can start it manually. This command exposes host directories to the minikube VM. ```sh minikube mount "/path/to/your/project:/path/to/your/project" ``` -------------------------------- ### Garden Project Configuration Example Source: https://github.com/garden-io/garden/blob/main/docs/tutorials/your-first-project/1-initialize-a-project.md This is a sample `project.garden.yml` file defining environments and providers for a Garden project. ```yaml apiVersion: garden.io/v2 kind: Project name: web-app-example defaultEnvironment: local environments: - name: local defaultNamespace: web-app-example variables: hostname: "local.demo.garden" - name: remote-dev defaultNamespace: web-app-example-${kebabCase(local.username)} - name: ci defaultNamespace: web-app-example-${git.branch}-${git.commitHash} - name: preview defaultNamespace: web-app-example-${git.branch} providers: - name: local-kubernetes environments: [local] - name: kubernetes environments: [remote-dev, ci, preview] ``` -------------------------------- ### Ingress Controller Installation Source: https://github.com/garden-io/garden/blob/main/docs/reference/providers/kubernetes.md Configure the installation of an ingress controller. ```APIDOC ## providers[].setupIngressController ### Description Set this to `traefik` or `nginx` to install the respective ingress controller. The nginx controller is deprecated and will be removed in a future version — we recommend using `traefik`. ### Type `string` ### Default `false` ### Required No ``` -------------------------------- ### Create New Project Source: https://github.com/garden-io/garden/blob/main/docs/guides/using-the-cli.md Bootstraps a boilerplate `garden.yml` and `.gardenignore` file in the current directory. ```sh garden create project ``` -------------------------------- ### Example: Specifying a build action in a deploy action Source: https://github.com/garden-io/garden/blob/main/docs/reference/action-types/Test/kubernetes-exec.md Demonstrates referencing an `exec` Build action within a `kubernetes` Deploy action. The output directory of the referenced build action becomes the source for the deploy action. ```yaml deploy: kubernetes: build: exec # ... other deploy config ``` -------------------------------- ### Update Garden CLI to a Specific Install Directory Source: https://github.com/garden-io/garden/blob/main/docs/reference/commands.md Installs the Garden CLI to a specified directory instead of the default location. This option implies --force and is useful for custom installations. ```bash garden self-update --install-dir ~/garden ``` -------------------------------- ### Create Working Directory Source: https://github.com/garden-io/garden/blob/main/e2e/projects/kustomize-modules/ldap/README.md Sets up a temporary directory to store the Kustomize configuration files for the demo. Alternatively, a persistent directory can be used. ```bash DEMO_HOME=$(mktemp -d) ``` ```bash DEMO_HOME=~/ldap ``` -------------------------------- ### Install Garden CLI on macOS Source: https://github.com/garden-io/garden/blob/main/docs/getting-started/quickstart.md Use Homebrew to install the Garden CLI on macOS. ```sh brew install garden-io/garden/garden-cli ``` -------------------------------- ### Basic Garden Deploy Commands Source: https://github.com/garden-io/garden/blob/main/docs/reference/commands.md Examples of basic 'garden deploy' commands for deploying all actions or specific ones. ```bash garden deploy # deploy everything in the project ``` ```bash garden deploy my-deploy # only deploy my-deploy ``` ```bash garden deploy deploy-a,deploy-b # only deploy deploy-a and deploy-b ``` -------------------------------- ### Start Development Server Source: https://github.com/garden-io/garden/blob/main/e2e/projects/vote-helm-modules/vote-image/README.md Compiles and hot-reloads the project for development. Access your application via the provided URL. ```bash npm run serve ``` -------------------------------- ### Install Garden CLI using PowerShell Script (Windows) Source: https://github.com/garden-io/garden/blob/main/docs/guides/installation.md Installs the Garden CLI and its dependencies on Windows using a PowerShell script. The script automatically installs Chocolatey and Git if necessary. Re-run the script to upgrade. ```powershell Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/garden-io/garden/main/support/install.ps1')) ``` -------------------------------- ### Install fsevents Source: https://github.com/garden-io/garden/blob/main/core/lib/fsevents/README.md Install the fsevents module using npm. Supports Node.js v8.16 and higher. ```sh npm install fsevents ``` -------------------------------- ### Set up GCP Project and Enable APIs Source: https://github.com/garden-io/garden/blob/main/examples/gke/README.md Configure your Google Cloud project ID, create a new project if necessary, link it to a billing account, and enable essential APIs for GKE and Compute Engine. ```sh export PROJECT_ID= gcloud projects create $PROJECT_ID gcloud alpha billing projects link $PROJECT_ID --billing-account= gcloud services enable compute.googleapis.com container.googleapis.com servicemanagement.googleapis.com --project $PROJECT_ID ``` -------------------------------- ### Install Root Dependencies Source: https://github.com/garden-io/garden/blob/main/docs/contributing/garden-dev-env-setup.md Installs Node.js modules for the root package of the Garden project. This is a prerequisite for bootstrapping. ```sh npm install ``` -------------------------------- ### Example `exec` Build with `kubernetes` Deploy Source: https://github.com/garden-io/garden/blob/main/docs/reference/action-types/Run/helm-pod.md Illustrates referencing an `exec` Build action within a `kubernetes` Deploy action. The output directory of the `exec` Build becomes the source for the Deploy action. ```yaml build: exec: "@garden/exec": # ... deploy: kubernetes: "@garden/kubernetes": build: "exec" # ... ``` -------------------------------- ### Install AEC Agent for Remote Clusters Source: https://github.com/garden-io/garden/blob/main/docs/garden-for/kubernetes/automatic-environment-cleanup.md Use this command to install the AEC agent in your remote Kubernetes cluster. ```bash garden plugins kubernetes setup-aec --env ``` -------------------------------- ### Spin up the stack Source: https://github.com/garden-io/garden/blob/main/docs/reference/commands.md Start your stack with the development console and streaming logs. This command is an alias for `garden dev --cmd 'deploy --logs'` and accepts arguments for the deploy command. ```bash garden up ``` -------------------------------- ### Get project dependency graph Source: https://github.com/garden-io/garden/blob/main/docs/reference/commands.md Use `garden get graph` to output the dependency relationships across the project. ```bash garden get graph ``` -------------------------------- ### Install Dependencies with asdf Source: https://github.com/garden-io/garden/blob/main/docs/contributing/garden-dev-env-setup.md For users of asdf version manager, this script automatically installs the correct plugins and versions as defined in the .tool-versions file. ```sh ./scripts/install-asdf-dependencies.sh ``` -------------------------------- ### Example Build Action Reference Source: https://github.com/garden-io/garden/blob/main/docs/reference/action-types/Run/exec.md Reference an 'exec' Build action within a 'kubernetes' Deploy action to use the Build's output directory as the source. This avoids looking for manifest files relative to the Deploy action's location. ```yaml kubernetes: deploys: my-app: build: exec # References an 'exec' Build action # ... other deploy configurations ``` -------------------------------- ### Link Local Source Example Source: https://github.com/garden-io/garden/blob/main/core/test/data/test-projects/local-project-sources/README.md Use this command to link a local directory as a source for a Garden project. This is typically done within the `test-projects/ext-project-sources` directory to point to a local source. ```bash # In test-projects/ext-project-sources dir garden link source source-a ../test-projects/local-project-sources/source-a ``` -------------------------------- ### Example: Referencing a build action in a deploy action Source: https://github.com/garden-io/garden/blob/main/docs/reference/action-types/Run/kubernetes-exec.md Demonstrates how to reference an `exec` Build action within a `kubernetes` Deploy action. This allows the Deploy action to use manifests generated by the Build action. ```yaml deploy: kind: kubernetes build: exec ``` -------------------------------- ### AEC Configuration Example Source: https://github.com/garden-io/garden/blob/main/docs/contributing/README.md Example configuration for the AEC feature within a Garden project, specifying triggers for pausing based on update time. ```yaml kind: Project environments: - name: default aec: triggers: - action: pause timeAfterLastUpdate: unit: minutes value: 1 ... ``` -------------------------------- ### Install Git and GCC on Alpine Linux Source: https://github.com/garden-io/garden/blob/main/docs/guides/installation.md Installs Git and GCC on Alpine Linux using the apk package manager. GCC is required for building. ```sh apk add --no-cache git apk add --no-cache gcc ``` -------------------------------- ### Project Folder Structure Source: https://github.com/garden-io/garden/blob/main/examples/cert-manager-ext-dns/README.md This outlines the directory structure for the cert-manager and ExternalDNS example project. ```bash ├── charts │ ├── cluster-issuers <- Creates cluster-issuers certificate. ├── frontend <- Deploys a React Application to the environment │ ├── Dockerfile │ ├── garden.yml │ ├── node_modules │ ├── package.json │ ├── package-lock.json │ ├── public │ └── src ├── garden.yml <- Contains the actions to deploy external-dns & cert-manager ├── project.garden.yml <- Contains the project configuration/env-vars. └── README.md ``` -------------------------------- ### Install AEC Agent for Local Clusters Source: https://github.com/garden-io/garden/blob/main/docs/garden-for/kubernetes/automatic-environment-cleanup.md Use this command to install the AEC agent in your local Kubernetes cluster (e.g., Docker Desktop, minikube). ```bash garden plugins local-kubernetes setup-aec --env ``` -------------------------------- ### Download Staging Overlay Resources Source: https://github.com/garden-io/garden/blob/main/e2e/projects/kustomize-modules/ldap/README.md Downloads the Kustomize configuration files for the staging environment, including a configMap definition and a modified deployment.yaml. These files are placed in the staging overlay directory. ```bash curl -s -o "$OVERLAYS/staging/#1" "$CONTENT/overlays/staging" /{config.env,deployment.yaml,kustomization.yaml}" ``` -------------------------------- ### Create Overlay Directories Source: https://github.com/garden-io/garden/blob/main/e2e/projects/kustomize-modules/helloWorld/README.md Creates the necessary directories for the staging and production overlays within the main overlays directory. ```bash OVERLAYS=$DEMO_HOME/overlays mkdir -p $OVERLAYS/staging mkdir -p $OVERLAYS/production ``` -------------------------------- ### Download Production Overlay Resources Source: https://github.com/garden-io/garden/blob/main/e2e/projects/kustomize-modules/ldap/README.md Downloads the Kustomize configuration files for the production environment, including a modified deployment.yaml. These files are placed in the production overlay directory. ```bash curl -s -o "$OVERLAYS/production/#1" "$CONTENT/overlays/production" /{deployment.yaml,kustomization.yaml}" ``` -------------------------------- ### Garden CLI Commands for Sync Mode Source: https://context7.com/garden-io/garden/llms.txt Demonstrates Garden CLI commands for deploying services with sync mode enabled. Includes deploying specific services, all services, and starting an interactive development console. ```bash # Deploy specific services with sync garden deploy api --sync # Deploy all services with sync enabled garden deploy --sync=* # Start interactive dev console with sync garden dev ``` -------------------------------- ### Force Reinstall Garden CLI Source: https://github.com/garden-io/garden/blob/main/docs/reference/commands.md Re-installs the Garden CLI even if the detected or specified version is the same as the currently installed version. Use this to ensure a clean installation. ```bash garden self-update --force ``` -------------------------------- ### Install Garden CLI using Homebrew (macOS) Source: https://github.com/garden-io/garden/blob/main/docs/guides/installation.md Installs the Garden CLI using Homebrew. To upgrade, run 'brew update' and 'brew upgrade garden-cli'. ```sh brew tap garden-io/garden brew install garden-cli ``` -------------------------------- ### Garden Actions with Dependencies and Output Referencing Source: https://github.com/garden-io/garden/blob/main/docs/getting-started/basics.md Demonstrates two simple 'Run' actions where the second action depends on the first and references its log output. This showcases action dependencies and output usage. ```yaml apiVersion: garden.io/v2 kind: Project name: my-project environments: # <--- Specifying environments is required - name: dev --- kind: Run name: say-hello type: exec spec: command: ["echo", "Hello ${local.username}"] --- kind: Run name: say-what type: exec dependencies: [run.say-hello] spec: command: ["echo", "Action say-hello says: '${actions.run.say-hello.outputs.log}'"] ``` -------------------------------- ### Old Pulumi Varfile Schema Example Source: https://github.com/garden-io/garden/blob/main/docs/garden-for/pulumi/README.md This is an example of the older Pulumi varfile schema. It directly lists configuration values without nesting them under a 'config' key. ```yaml kubernetes:context: orbstack pulumi-k8s:namespace: ns-from-the-varfile ``` -------------------------------- ### garden get variables Source: https://github.com/garden-io/garden/blob/main/docs/reference/commands.md Get variables. Lists variables in this project, both those defined in the project configuration and in individual actions, and including remote variables and variables from varfiles. ```APIDOC ## garden get variables ### Description Get variables. Lists variables in this project, both those defined in the project configuration and in individual actions, and including remote variables and variables from varfiles. This is useful for seeing where variables are set and what value they resolve to when using template strings. Note that by default, template strings are not resolved for action-level variables. To resolve all template strings, use the `--resolve=full` option. Note that this may trigger actions being executed in case a given action references the runtime output of another in its `variables` field. ### Method GET ### Endpoint garden get variables [options] ### Parameters #### Query Parameters - **--resolve** (string) - Optional - Resolve template strings. Use `full` to resolve all template strings, including runtime outputs. - **--filter-actions** (string) - Optional - Filter variables by action names. Specify multiple actions separated by spaces. - **--output** (string) - Optional - The output format for variables. Allowed values: `json`. ### Examples ```bash garden get variables garden get variables --resolve full garden get variables --filter-actions build.api --filter-actions deploy.api garden get variables --output json ``` ``` -------------------------------- ### Install AEC Agent in Kubernetes Source: https://github.com/garden-io/garden/blob/main/docs/garden-for/kubernetes/automatic-environment-cleanup.md Use this command to install the AEC agent in your Kubernetes cluster. It sets up a service account, deploys the agent, and configures necessary permissions. ```bash garden plugins kubernetes setup-aec --env ```