Merge "Move unimgr Sonar scan to Sonarcloud"
[releng/builder.git] / jjb / integration / update-csit-tests.sh
1 #!/bin/bash
2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2017 The Linux Foundation and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11 echo "---> update-csit-tests.sh"
12
13 jobs_file=$(mktemp)
14 search_string="csit"
15
16 wget --quiet -O "$jobs_file" "https://jenkins.opendaylight.org/$SILO/api/xml"
17 # shellcheck disable=SC2207
18 jobs=($(xmlstarlet sel -t -m '//hudson/job' \
19     -n -v 'name' "$jobs_file" | grep $search_string | grep "$STREAM"))
20
21 # output as comma-separated list
22 job_list="${WORKSPACE}/jjb/integration/csit-jobs-${STREAM}.lst"
23 rm "$job_list"
24 for job in "${jobs[@]}"; do
25     echo "Checking if $job is blocklisted."
26     if [[ ! $job =~ update-csit-tests|${CSIT_BLOCKLIST// /\|} ]]; then
27         echo "${job}," >> "$job_list"
28         echo "    Added $job to job list."
29     fi
30 done