Skip to content

Commit

Permalink
Create "getting started" section
Browse files Browse the repository at this point in the history
  • Loading branch information
majori committed Nov 3, 2023
1 parent 81b411a commit 72f190c
Showing 1 changed file with 42 additions and 7 deletions.
49 changes: 42 additions & 7 deletions docs/site/docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 72f190c

Please sign in to comment.