Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

define environment variables for task per system #83

Open
anonymouse64 opened this issue Aug 8, 2019 · 0 comments
Open

define environment variables for task per system #83

anonymouse64 opened this issue Aug 8, 2019 · 0 comments

Comments

@anonymouse64
Copy link

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 anonymouse64 changed the title define environment variables per system define environment variables for task per system Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant