Merge "Update cloud image Ubuntu18.04 mininet ovs"
[releng/builder.git] / jjb / opendaylight-infra-update-image-list.sh
1 #!/bin/bash -l
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
12 set -e -o pipefail
13
14 # shellcheck disable=SC1090
15 . ~/lf-env.sh
16
17 lf-activate-venv --python python3 python-openstackclient
18
19 cat > "$WORKSPACE/docs/cloud-images.rst" << EOF
20 Following are the list of published images available to Jenkins jobs.
21
22 EOF
23 # Blank line before EOF is on purpose to ensure there is spacing.
24
25 IFS=$'\n'
26 # We purposely want globbing here to build images list
27 # shellcheck disable=SC2207
28 IMAGES=($(openstack image list --long -f value -c Name -c Protected \
29     | grep 'ZZCI.*True' | sed 's/ True//'))
30 for i in "${IMAGES[@]}"; do
31     echo "Adding image $i"
32     echo "* $i" >> "$WORKSPACE/docs/cloud-images.rst"
33 done
34
35 git add docs/cloud-images.rst