You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this example, the service defined in the `backup-service` directory will only be started when the cron schedule is met. After its first run, it will continue to be managed by its cron schedule.
172
172
173
-
### Step 6: Start and Verify the Deployment
173
+
### Step 6: Using Variables (Optional)
174
+
175
+
Dispenser supports using variables in your configuration file via `dispenser.vars`. This file allows you to define values that can be reused inside `dispenser.toml` using `{{ VARIABLE }}` syntax.
176
+
177
+
This is useful forreusing the same configurationin multiple deployments.
178
+
179
+
1. Create a `dispenser.vars` file in`/opt/dispenser`.
180
+
181
+
```sh
182
+
vim dispenser.vars
183
+
```
184
+
185
+
2. Define your variables in TOML format.
186
+
187
+
```toml
188
+
registry_url = "ghcr.io"
189
+
app_version = "latest"
190
+
```
191
+
192
+
3. Use these variables in your `dispenser.toml`.
193
+
194
+
```toml
195
+
[[instance]]
196
+
path = "my-app"
197
+
images = [{ registry ="{{ registry_url }}", name ="my-org/my-app", tag ="{{ app_version }}" }]
198
+
```
199
+
200
+
### Step 7: Validating Configuration
201
+
202
+
Before applying changes, you can validate your configuration files (including variable substitution) to ensure there are no syntax errors or missing variables.
203
+
204
+
Run dispenser with the `--test` (or `-t`) flag:
205
+
206
+
```sh
207
+
dispenser --test
208
+
```
209
+
210
+
If the configuration is valid, it will output:
211
+
```
212
+
Dispenser config is ok.
213
+
```
214
+
215
+
If there's an error `dispenser` will show you a detailed error message.
0 commit comments