]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-ansible-nightly: take the first tag only in find_latest_tag 1093/head
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 25 Jul 2018 09:21:36 +0000 (11:21 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 25 Jul 2018 09:21:36 +0000 (11:21 +0200)
`find_latest_tag()` might return more than 1 tag if two tags match the
`jq` query in a same page of results. This breaks the nightly jobs.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
ceph-ansible-nightly/build/build

index fc20670598927936baf8931d9f955fdb8ddc053a..0c869f45bfb96a75fcfb4d1d5fef194af7cf750f 100644 (file)
@@ -24,7 +24,7 @@ function find_latest_tag {
   for page in $(seq 1 $total_pages); do
     tag=$(curl -s "https://registry.hub.docker.com/v2/repositories/ceph/daemon/tags/?page=$page" | jq ".\"results\"[] | select((.name | contains(\"stable\")) and (.name | contains(\"${release}-centos-7-x86_64\"))) | .name")
     if [ -n "$tag" ]; then
-      echo "$tag" | cut -d '"' -f 2
+      echo "$tag" | head -n 1 | cut -d '"' -f 2
       return
     fi
   done