From 72f190cf6084f069dc9d0c9e058175e6296dc0fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20Kivim=C3=A4ki?= Date: Fri, 3 Nov 2023 15:01:15 +0200 Subject: [PATCH] Create "getting started" section --- docs/site/docs/usage.md | 49 +++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/docs/site/docs/usage.md b/docs/site/docs/usage.md index 4f42dbb2..75454f3b 100644 --- a/docs/site/docs/usage.md +++ b/docs/site/docs/usage.md @@ -8,18 +8,47 @@ title: Usage ## Getting started -`jalapeno create my-recipe` +To get started with Jalapeno, you need to install the CLI tool. You can find the installation instructions [here](/installation). -- Add variable -- Use that variable in templates +Then you can bootstrap a new _recipe_ (aka template) by running: -`jalapeno execute my-recipe` +```bash +jalapeno create my-recipe +``` -## Variables +After this you should have a new folder called `my-recipe` with the following structure: -### Validation +``` +my-recipe +├── recipe.yml +├── templates +│ └── README.md +└── tests + └── defaults + ├── test.yml + └── files + └── README.md +``` -### Conditional variables +The `templates` directory contains the templates which will be rendered to the project directory. You can add and edit files there or you can already execute this _recipe_ (render the templates) to your project directory by running: + +```bash +mkdir my-project +jalapeno execute my-recipe -d my-project +``` + +After this, the project directory should have the following files: + +``` +my-project +├── .jalapeno +│ └── sauces.yml +└── README.md +``` + +The `.jalapeno` directory contains files which Jalapeno uses internally. For example `sauces.yml` is Jalapeno metadata file which contains information about the _sauces_ (aka executed recipes). This file is used to check for updates for the recipes later. + +The rest of the files are rendered from the templates. You can edit the templates and execute the recipe again to update the files. ## Templating @@ -33,6 +62,12 @@ The following context is available on the templates: - `ID`: UUID which is generated after the first execution of the recipe. It will keep its value over upgrades. Can be used to generate unique pseudo-random values which stays the same over the upgrades, for example `my-resource-{{ sha1sum .ID | trunc 5 }}` - `Variables`: Object which contains the values of the variables defined for the recipe. Example: `{{ .Variables.FOO }}` +## Variables + +### Validation + +### Conditional variables + ## Pushing recipe to Container Registry ### Executing a recipe from local path