Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@worldofgeese
Last active May 24, 2023 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save worldofgeese/d38353951d4b144c5f2bd5155913cc48 to your computer and use it in GitHub Desktop.
Save worldofgeese/d38353951d4b144c5f2bd5155913cc48 to your computer and use it in GitHub Desktop.
Cloud Shell Garden tutorial

Garden quickstart for Cloud Shell

Let's get started

This quickstart will show you how to start a minikube cluster and deploy a simple application to it using Garden.

  • Setup your environment
    • Install Garden and start a minikube cluster you'll use to deploy your app to.
  • Deploy the app
    • You will be guided through the process of deploying a simple app to the cluster using Garden.
  • Explore the dev console
    • Run tests, view logs, and more.

Time to complete: Click the Start button to move to the next step.

Setup your environment

Open the Cloud Shell

Open Cloud Shell by clicking in the navigation bar at the top of the console.

Run the setup script

Run the start script to prepare the environment. The script will install the latest version of garden and its dependencies:

chmod +x start.sh && ./start.sh

Start your cluster

Create a minikube cluster by running:

minikube start

(Optional) Logging in to the Garden Dashboard

Garden has a web-based UI, Garden Dashboard, complementing the Garden Core CLI tool. The Dashboard is available at https://app.garden.io. It is optional to use the Dashboard when going through this quickstart guide.

If you try out the Dashboard, make sure to log in on the command line using

garden login

After a successful login, all commands will be streamed through to the Garden Dashboard.

Deploy the app

Use Cloud Shell to clone and navigate to the sample code to the Cloud Shell.

Note: If the directory already exists, remove the previous files before cloning.

git clone https://github.com/garden-io/quickstart-example && cd quickstart-example

Garden ships with an interactive command center we call the dev console. To start the dev console, run:

garden dev

The first time you run garden dev, Garden will initialize then await further instructions inside a REPL. From inside the REPL you can command Garden to build, test, and deploy your project.

After running garden dev, you're ready to deploy your project. Run:

deploy

Explore the dev console

Still in the dev console, run a unit test:

test unit-vote

And end-to-end tests:

test e2e

Make your own

These are tests shipped in the quickstart. Inspect their contents (or write your own!) by opening the garden.yml files for the unit test and an e2e test.

Cleanup your environment with:

cleanup namespace

And exit the dev console by typing:

exit

Next Steps

Now that you have Garden installed and seen its basic capabilities it's time to take the next steps.

If you'd like to better understand how a Garden project is configured, we recommend going through our first project tutorial which walks you through configuring a Garden project step-by-step.

If you like to dive right in and configure your own project for Garden, we recommend referencing our example projects on GitHub and the section of our docs titled Using Garden, which covers all parts of Garden in detail.

If you have any questions or feedback—or just want to say hi 🙂—we encourage you to join our Discord community!

#!/bin/sh
# Install Garden and dependencies (Git is already included)
sudo apt-get install -y rsync
curl -sL https://get.garden.io/install.sh | bash
echo 'export PATH=$PATH:$HOME/.garden/bin' >> ~/.bashrc
source ~/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment