Pašlaik „typo3solr/ext-solr“ paketes Docker attēls atrodas ar atzīmi „14.0.x-dev“. Šī ir pagaidu atzīme, kas drīz pazudīs. Man tas ir jāuzrauga, jo daži no maniem projektiem ir atkarīgi no solr Docker attēla. Es varētu katru dienu apmeklēt attēla lapu Docker Hub vietnē, taču nolēmu to automatizēt un uzrakstīju skriptu cron lietošanai savā macOS. Tas reizi dienā pārbaudīs tagu un ziņos, ja tas pazudīs.
#!/usr/bin/env bash
TOKEN=$(curl -s "https://auth.docker.io/token?service=registry.docker.io&scope=repository:typo3solr/ext-solr:pull" | jq -r .token)
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" \
-H "Authorization: Bearer $TOKEN" \
-H "Accept: application/vnd.docker.distribution.manifest.v2+json" \
"https://registry-1.docker.io/v2/typo3solr/ext-solr/manifests/14.0.x-dev")
if [ "$HTTP_CODE" -ne 200 ]; then
osascript -e 'display notification "Docker tag 14.0.x-dev disappeared" with title "Attention!"'
fi
0 18 * * * /Users/username/bin/check-solr-tags.sh &> /dev/null