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
* Add templating to porter config file
Support templating in the Porter config file, e.g.
~/.porter/config.json|toml|yaml.
The template syntax uses a yaml-friendly delimiiter, ${}. For example,
${env.NAME} or ${secret.NAME}. If you are using toml or json for your
config file format, then you may need to use quotes around template
values to ensure that the config file has valid syntax when it is
loaded.
We load the config file first with only environment variables
substituted, then we initialize the secrets plugin, and finally do a
second pass of the config file to replace any secrets. So that first
pass needs to be a valid file based on the current format.
For example, in a porter.toml file, secrets should be quoted:
```toml
[[storage]]
name = "dev"
plugin = "mongodb"
[storage.config]
url = "${secret.connection-string}"
```
Only environment variables and secrets can be substituted. The secrets
are resolved from the default secret storage.
I am implementing this with the liquid template engine (from shopify
that was ported to Go). I don't want us to commit to supporting liquid
templates at this time, it's just an implementaiton detail that liquid
is used at the moment and it could change later.
Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
* Review feedback
Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
description: Controlling Porter with its config file, environment variables and flags
4
4
---
5
5
6
+
Porter has a hierarchical configuration system that loads configuration values in the following precedence order:
7
+
8
+
* Flags (highest)
9
+
* Environment Variables
10
+
* Config File (lowest)
11
+
12
+
You may set a default value for a configuration value in the config file, override it with an environment variable, and then override both for a particular command with a flag.
Some configuration settings are applicable to many of Porter's commands and to save time you may want to set these values in the configuration file or with environment variables.
292
+
293
+
### Namespace
294
+
\--namespace specifies the current namespace.
295
+
It is set with the PORTER_NAMESPACE environment variable.
296
+
297
+
```toml
298
+
namespace = "dev"
299
+
```
300
+
301
+
### Debug
302
+
303
+
\--debug is a flag that is understood not only by the porter client but also the runtime and most mixins.
304
+
They may use it to print additional information that may be useful when you think you may have found a bug, when you want to know what commands they are executing, or when you need really verbose output to send
305
+
to the developers.
306
+
It is set with the PORTER_DEBUG environment variable.
307
+
308
+
```toml
309
+
debug = true
310
+
```
311
+
312
+
### Debug Plugins
313
+
314
+
\--debug-plugins controls if logs related to communication between porter and its plugins should be printed when debugging.
315
+
This can be _very_ verbose, so it is not turned on by default when debug is true.
316
+
It is set with the PORTER_DEBUG_PLUGINS environment variable.
317
+
318
+
```toml
319
+
debug-plugins = true
320
+
```
321
+
322
+
### Output
323
+
324
+
\--output controls the format of the command output printed by porter.
325
+
It is set with the PORTER_OUTPUT environment variable.
326
+
Each command supports a different set of allowed outputs though usually there is some combination of: plaintext, json, and yaml.
327
+
328
+
```toml
329
+
output = "json"
330
+
```
331
+
332
+
### Allow Docker Host Access
333
+
334
+
\--allow-docker-host-access controls whether the local Docker daemon or host should be made available to executing bundles.
335
+
It is set with the PORTER_ALLOW_DOCKER_HOST_ACCESS environment variable.
336
+
337
+
This flag is available for the following commands: install, upgrade, invoke, and uninstall.
338
+
When this value is set to true, bundles are executed in a privileged container with the docker socket mounted.
339
+
This allows you to use Docker from within your bundle, such as `docker push`, `docker-compose`, or docker-in-docker.
340
+
341
+
🚨 **There are security implications to enabling access!
342
+
You should trust any bundles that you execute with this setting enabled as it gives them elevated access to the host machine.**
343
+
344
+
⚠️️ This configuration setting is only available when you are in an environment that provides access to the local docker daemon.
345
+
Therefore, it does not work with the Azure Cloud Shell driver.
0 commit comments