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

Remove string to boolean expression conversion for node's labels #1767

Merged
merged 1 commit into from
Apr 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions buildenv/jenkins/common/variables-functions
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,14 @@ def get_user_credentials_id(KEY) {
/*
* Sets the NODE variable to the labels identifying nodes by platform suitable
* to run a Jenkins job.
* Fetches the labels from the variables file when the NODE is not set as build
* parameter.
* The node's labels could be a single label - e.g. label1 - or a boolean
* expression - e.g. label1 && label2 || label3.
*/
def set_node(job_type) {
// fetch labels (space separated string) for given platform/spec
labels = get_value(VARIABLES."${SPEC}".node_labels."${job_type}", SDK_VERSION)
NODE = labels.replaceAll(" ", "&&")
// fetch labels for given platform/spec
NODE = (!params.NODE) ? get_value(VARIABLES."${SPEC}".node_labels."${job_type}", SDK_VERSION) : params.NODE
if (!NODE) {
error("Cannot find label value matching JOB_TYPE:'${job_type}' SPEC:'${SPEC}' and SDK_VERSION:'${SDK_VERSION}'")
}
Expand Down