← Back to issue list

snapcraft should support using HOST for environment like spread does

View original Launchpad issue

Metadata

Project
snapcraft
Number
#1893672
Type
issue
State
open
Author
~anonymouse67
Labels
Created
2020-08-31 15:46:29.719706+00:00
Updated
2021-02-25 14:04:17.728956+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

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

Evaluation history

No evaluation history available.