]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-ansible-nightly: auto discover latest stable tag 984/head
authorSébastien Han <seb@redhat.com>
Thu, 15 Mar 2018 15:42:13 +0000 (16:42 +0100)
committerSébastien Han <seb@redhat.com>
Thu, 15 Mar 2018 17:15:18 +0000 (18:15 +0100)
Instead of sending a commit each time we build a new release, we
discover it through the script.

Signed-off-by: Sébastien Han <seb@redhat.com>
ceph-ansible-nightly/build/build

index aed376f1bb33f4494b376bfb7a8aae61989de0a8..f504429cf9b7ce7a0f469304baa956642852333f 100644 (file)
@@ -14,11 +14,16 @@ clear_libvirt_networks
 restart_libvirt_services
 update_vagrant_boxes
 
+sudo yum -y install jq
+
+LAST_JEWEL_STABLE_TAG=$(curl -s https://registry.hub.docker.com/v2/repositories/ceph/daemon/tags/ | jq '."results"[] | select((.name | contains("stable")) and (.name | contains("jewel-ubuntu-16.04"))) | .name' | sort)
+LAST_LUMINOUS_STABLE_TAG=$(curl -s https://registry.hub.docker.com/v2/repositories/ceph/daemon/tags/ | jq '."results"[] | select((.name | contains("stable")) and (.name | contains("luminous-ubuntu-16.04"))) | .name' | sort)
+
 if [ "$RELEASE" == 'jewel' ] && [ "$CEPH_ANSIBLE_BRANCH" == 'stable-2.2' -o "$CEPH_ANSIBLE_BRANCH" == 'stable-3.0' ]; then
-  start_tox CEPH_DOCKER_IMAGE_TAG=tag-stable-3.0-jewel-centos-7
+  start_tox CEPH_DOCKER_IMAGE_TAG="$LAST_JEWEL_STABLE_TAG"
 elif [ "$RELEASE" == 'luminous' ] && [ "$CEPH_ANSIBLE_BRANCH" == 'stable-3.0' ]; then
   # start_tox(): <CEPH_DOCKER_IMAGE_TAG> <CEPH_STABLE_RELEASE>
-  start_tox CEPH_DOCKER_IMAGE_TAG=tag-stable-3.0-luminous-centos-7
+  start_tox CEPH_DOCKER_IMAGE_TAG="$LAST_LUMINOUS_STABLE_TAG"
 elif [ "$RELEASE" == 'luminous' ] && [ "$CEPH_ANSIBLE_BRANCH" == 'master' ]; then
-  start_tox CEPH_DOCKER_IMAGE_TAG=tag-build-master-luminous-ubuntu-16.04
+  start_tox CEPH_DOCKER_IMAGE_TAG=latest
 fi