Merge "Migrate docs jobs to use lf-infra-publish"
[releng/builder.git] / jjb / opendaylight-infra-update-image-list.sh
1 #!/bin/bash
2 virtualenv "$WORKSPACE/.venv"
3 # shellcheck disable=SC1090
4 source "$WORKSPACE/.venv/bin/activate"
5 PYTHON="$WORKSPACE/.venv/bin/python"
6 $PYTHON -m pip install --upgrade --quiet pip
7 $PYTHON -m pip install --upgrade --quiet python-openstackclient python-heatclient
8 $PYTHON -m pip freeze
9
10 cat > "$WORKSPACE/docs/cloud-images.rst" << EOF
11 Following are the list of published images available to be used with Jenkins jobs.
12
13 EOF
14 # Blank line before EOF is on purpose to ensure there is spacing.
15
16 IFS=$'\n'
17 IMAGES=($(openstack image list --public -f value -c Name))
18 for i in "${IMAGES[@]}"; do
19     echo "* $i" >> "$WORKSPACE/docs/cloud-images.rst"
20 done
21
22 git add docs/cloud-images.rst