From f44dccbc223adda12647db16d8db3c9a2245ecf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Saraj=C3=A4rvi?= Date: Tue, 13 Oct 2015 09:14:18 +0300 Subject: Enable using suffixes on node labels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie369aa7fa52c0ae41f41a10d59763e48050222ac Reviewed-by: Johanna Äijälä Reviewed-by: Matti Paaso --- scripts/jenkins/qt-jenkins-deploy.pl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'scripts/jenkins') diff --git a/scripts/jenkins/qt-jenkins-deploy.pl b/scripts/jenkins/qt-jenkins-deploy.pl index 8cdb41ee..4dadb95f 100755 --- a/scripts/jenkins/qt-jenkins-deploy.pl +++ b/scripts/jenkins/qt-jenkins-deploy.pl @@ -719,10 +719,24 @@ sub desired_job_xml squish_test_suites => \@squish_test_suites, auth_token => eval { $self->cfg( "job.$name", 'auth_token' ) } || q{}, job_description => eval { $self->cfg( "job.$name", 'job_description' ) } || q{}, + suffix_labels => eval { $self->cfg( "job.$name", 'suffix_labels' ) } || q{0}, }, \$data ) || die "job $name: while parsing template: ".$tt->error(); + my $suffix_labels = eval { $self->cfg( "job.$name", 'suffix_labels' ) } || q{0}; + if ($suffix_labels) { + # Add the configurations to the combination filter and after that replace all + # instances of the configuration with the suffix of $ini_branch + my $ini_branch = eval { $self->cfg( "job.$name", 'template_ini_prefix' ) } // $branch; + foreach my $cfg (@configurations) { + $data =~ s/<\/combinationFilter>/(cfg == \"$cfg-$ini_branch\") || <\/combinationFilter>/; + $data =~ s/\\Q$cfg\E\<\/string\>/$cfg-$ini_branch<\/string>/g; + } + # Remove the excess " || " from the end of the combinationFilter string + $data =~ s/ \|\| <\/combinationFilter/<\/combinationFilter/; + } + chomp $data; return $data; } -- cgit v1.2.3