#!/bin/bash
#set -x

prog=`basename $0`
o=openstack

usage ()
{
    echo -e "Usage: $prog <tag> \n"
    echo "  tag: f20 f21 rawhide epel7"
}

tag=$1

query_koji()
{

for i in $tag;
  do
    for j in $o-nova $o-glance $o-cinder $o-neutron $o-keystone \
        $o-heat python-django-horizon $o-swift $o-ceilometer \
        $o-ironic $o-tripleo; do
        koji latest-build $i $j | awk '{print $1}';
    done
  done
}

# main
{

    # check if min no. of arguments are 1
    if [ "$#" != 1 ]; then
        usage;
        exit 255
    fi
    query_koji
}    

