If you need a Drone pipeline (.drone.yml) step in which you’re waiting for a Docker image tag to be available in Quay.io, here is my solution that is working fine. Basically a loop that is using curl and grep checking if tag string is present

---
kind: pipeline
type: kubernetes
name: deployment

platform:
  os: linux
  arch: amd64

trigger:
  event:
    - push
  branch:
    - main

steps:
  - name: Wait for image tag to be present in Quay.io
    image: alpine/curl:8.2.1
    commands: 
    - |
       while ! curl -s -L 'https://quay.io/api/v1/repository/repository_name_here/tag?specificTag=${DRONE_COMMIT_SHA}' | grep -q '${DRONE_COMMIT_SHA}' ; do
          echo "Tag not present, waiting 10 seconds"
          sleep 10
        done

Seweryn

Cześć. Mam na imię Seweryn i jestem związany z IT już od lat 90. Jest to moje hobby i stała, która towarzyszy mi i chyba będzie do końca życia. Najbardziej interesują mnie takie dziedziny jak programowanie, bazy danych, analiza danych, web design. Posiadam kilka certyfikatów rozpoznawalnych w "przemyśle IT". M. in. Certified Oracle Java 8 Associate, Certified Amazon Cloud Practitioner, Certified Python Programmer. Mam także Professional Diploma in Digital Marketing oraz Certyfikat Data Analysis for Management z LSE : London School of Economics and Political Science

0 Komentarzy

Dodaj komentarz