Merge "Add a swap file to build machines"
[releng/builder.git] / jjb / opendaylight-infra-update-image-list.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
12 virtualenv "/tmp/v/openstack"
13 # shellcheck source=/tmp/v/openstack/bin/activate disable=SC1091
14 source "/tmp/v/openstack/bin/activate"
15 pip install --upgrade --quiet pip
16 pip install --upgrade --quiet python-openstackclient python-heatclient
17 pip install --upgrade pipdeptree
18 pipdeptree
19
20 cat > "$WORKSPACE/docs/cloud-images.rst" << EOF
21 Following are the list of published images available to be used with Jenkins jobs.
22
23 EOF
24 # Blank line before EOF is on purpose to ensure there is spacing.
25
26 IFS=$'\n'
27 # We purposely want globbing here to build images list
28 # shellcheck disable=SC2207
29 IMAGES=($(openstack image list --long -f value -c Name -c Protected \
30     | grep 'ZZCI.*True' | sed 's/ True//'))
31 for i in "${IMAGES[@]}"; do
32     echo "Adding image $i"
33     echo "* $i" >> "$WORKSPACE/docs/cloud-images.rst"
34 done
35
36 git add docs/cloud-images.rst