Skip to content

Commit

Permalink
docker: allow customizing Travis global_env variables
Browse files Browse the repository at this point in the history
This is useful so that we can do builds at higher than -j3 when running
travis.py locally.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
  • Loading branch information
bonzini authored and stsquad committed Jul 18, 2017
1 parent 5a477a7 commit 6ca9f7f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/docker/travis.py
Expand Up @@ -21,20 +21,20 @@ def load_yaml(fname):
def conf_iter(conf):
def env_to_list(env):
return env if isinstance(env, list) else [env]
global_env = conf["env"]["global"]
for entry in conf["matrix"]["include"]:
yield {"env": global_env + env_to_list(entry["env"]),
yield {"env": env_to_list(entry["env"]),
"compiler": entry["compiler"]}
for entry in itertools.product(conf["compiler"],
conf["env"]["matrix"]):
yield {"env": global_env + env_to_list(entry[1]),
yield {"env": env_to_list(entry[1]),
"compiler": entry[0]}

def main():
if len(sys.argv) < 2:
sys.stderr.write("Usage: %s <travis-file>\n" % sys.argv[0])
return 1
conf = load_yaml(sys.argv[1])
print "\n".join((": ${%s}" % var for var in conf["env"]["global"]))
for config in conf_iter(conf):
print "("
print "\n".join(config["env"])
Expand Down

0 comments on commit 6ca9f7f

Please sign in to comment.