From f8722b9396fd28b03f9be29fd58d96cfcc9bd76d Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Mon, 18 May 2020 12:42:21 -0700 Subject: [PATCH] cicd: Prefer 'fast' work items Process the other ones later. And pull latest 'wlan-ap' dir if it exists, so we can get up-to-date git log. --- cicd/testbed_poll.pl | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/cicd/testbed_poll.pl b/cicd/testbed_poll.pl index f53c1b3b9..13ceb712c 100755 --- a/cicd/testbed_poll.pl +++ b/cicd/testbed_poll.pl @@ -75,6 +75,24 @@ my $cmd = "curl $cuser $url"; print ("Calling command: $cmd\n"); my $listing = do_system($cmd); my @lines = split(/\n/, $listing); + +# First, if any have 'fast' in them, they get precedence. +for ($i = 0; $i<@lines; $i++) { + my $ln = $lines[$i]; + chomp($ln); + my $fast = 0; + if ($ln =~ /href=\"(CICD_TEST-.*-fast)\">(.*)<\/a>\s+(.*)\s+\S+\s+\S+/) { + $fast = 1; + } + elsif ($ln =~ /href=\"(CICD_TEST-.*-fast)\">(.*)<\/a>/) { + $fast = 1; + } + if ($fast) { + @lines[0] = $ln; + last; + } +} + for ($i = 0; $i<@lines; $i++) { my $ln = $lines[$i]; chomp($ln); @@ -150,6 +168,11 @@ for ($i = 0; $i<@lines; $i++) { exit(1); } + # Refresh wlan-ap repo if it exists. + if ( -d "../../../wlan-ap") { + do_system("cd ../../../wlan-ap && git pull && cd -"); + } + my $cmd = "curl --location -o $jfile -u $jfrog_user:$jfrog_passwd $jurl/$jfile"; do_system($cmd);