spread icon indicating copy to clipboard operation
spread copied to clipboard

define environment variables for task per system

Open anonymouse64 opened this issue 6 years ago • 0 comments

It would be useful to be able to define environment variables per system in the yaml, currently I have something like this:

prepare: |
    case "$SPREAD_SYSTEM" in
        ubuntu-16*)
            NETPLAN_APT_PKG=nplan;;
        *)
            NETPLAN_APT_PKG=netplan.io;;
    esac
    apt install $NETPLAN_APT_PKG

it would be nice if the variants for tasks also allowed specifying environment variables per system, something like this in the task.yaml:

environment:
  ubuntu-16.04-64:
    NETPLAN_APT_PKG: nplan
  *:
    NETPLAN_APT_PKG: netplan.io

I realize the above wouldn't work directly, but some way of communicating to define a specific environment variable for the same task variant depending on which system the task is running on. There exists the inverse setup where you can define an environment variable for all tasks that run on a system, but that isn't ideal for this use case.

anonymouse64 avatar Aug 08 '19 18:08 anonymouse64