snapcraft should support using HOST for environment like spread does

Bug #1893672 reported by Ian Johnson on 2020-08-31
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Wishlist
Unassigned

Bug Description

With spread ( https://github.com/snapcore/spread ), I can do things like this:

```
environment:
  SPREAD_VAR: '$(HOST: echo "${SPREAD_VAR:-somedefault}")'
```

where if I don't define the SPREAD_VAR variable when calling spread, it will have a default value, but spread also supports more generic things because the HOST: syntax is just a shell script snippet, so it could do other things to get the value of a variable and output it.

Snapcraft should support something like this to be able to define variables inside snapcraft.yaml which can get their values from the host. Some use cases this would solve for snapcraft:

* easy injection of secret keys into a build
* easy inclusion of debug symbols/assets when a developer wants to include this
* changing what versions of parts to use when building the snap

Sergio Schvezov (sergiusens) wrote :

We need to think about this one further. It does look like a good idea though

Changed in snapcraft:
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers