Skip to content

Commit

Permalink
release.nix: respect bash env, provide fallback values
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Apr 19, 2016
1 parent e1ff0a3 commit 8982625
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ let
url = "http://lab1.snabb.co:2008/~max/assets/vm-ubuntu-trusty-14.04-dpdk-snabb.tar.gz";
sha256 = "0323591i925jhd6wv8h268wc3ildjpa6j57n4p9yg9d6ikwkw06j";
};
optionalGetEnv = first: default: let
maybeEnv = builtins.getEnv first;
in if (maybeEnv != "") then maybeEnv else default;
in rec {
manual = import ./src/doc {};
snabb = import ./default.nix {};
Expand Down Expand Up @@ -42,9 +45,9 @@ in rec {

doCheck = true;
checkPhase = ''
export SNABB_PCI0="0000:01:00.0"
export SNABB_PCI_INTEL1="0000:01:00.1"
export SNABB_PCI_INTEL0="0000:01:00.0"
export SNABB_PCI0=${ optionalGetEnv "SNABB_PCI0" "0000:01:00.0"}
export SNABB_PCI_INTEL0=${ optionalGetEnv "SNABB_PCI_INTEL0" "0000:01:00.0"}
export SNABB_PCI_INTEL1=${ optionalGetEnv "SNABB_PCI_INTEL1" "0000:01:00.1"}
export FAIL_ON_FIRST=true
# run tests
Expand Down

0 comments on commit 8982625

Please sign in to comment.