Skip to content

Commit

Permalink
Fix platform name for workers with specified versions of Java
Browse files Browse the repository at this point in the history
  • Loading branch information
philwo committed Sep 6, 2018
1 parent 3d6e3ab commit 5b7f38a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions buildkite/bazelci.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,12 @@ def eprint(*args, **kwargs):
print(*args, flush=True, file=sys.stderr, **kwargs)


def rchop(string_, *endings):
for ending in endings:
if string_.endswith(ending):
return string_[:-len(ending)]
return string_

def python_binary(platform=None):
if platform == "windows":
return "python.exe"
Expand Down Expand Up @@ -1029,7 +1035,7 @@ def runner_step(platform, project_name=None, http_config=None,
"agents": {
"kind": "worker",
"java": PLATFORMS[platform]["java"],
"os": host_platform
"os": rchop(host_platform, "_nojava", "_java8", "_java9", "_java10")
}
}

Expand Down Expand Up @@ -1105,7 +1111,7 @@ def bazel_build_step(platform, project_name, http_config=None, file_config=None,
"agents": {
"kind": "worker",
"java": PLATFORMS[platform]["java"],
"os": host_platform
"os": rchop(host_platform, "_nojava", "_java8", "_java9", "_java10")
}
}

Expand Down

0 comments on commit 5b7f38a

Please sign in to comment.