Skip to content

Commit c793464

Browse files
author
benjamin
committed
fix: switch to skopeo to avoid REST rate limits
1 parent ae1049a commit c793464

5 files changed

Lines changed: 45 additions & 90 deletions

File tree

.github/workflows/base-glibc-busybox-bash.yaml

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -150,25 +150,16 @@ jobs:
150150
151151
- name: Check Tags
152152
run: |
153-
# FIX upstream: Quay.io does not support immutable images currently.
154-
# => Try to use the REST API to check for duplicate tags.
155-
response="$(
156-
curl -sL \
157-
'https://quay.io/api/v1/repository/bioconda/${{ steps.build.outputs.image }}/tag/'
158-
)"
159-
153+
# Quay.io does not support immutable images.
154+
# => Check for duplicate tags to avoid overwriting existing images.
160155
existing_tags="$(
161-
printf %s "${response}" \
162-
| jq -r '.tags[]|select(.end_ts == null or .end_ts >= now)|.name'
163-
)" \
164-
|| {
165-
printf %s\\n \
166-
'Could not get list of image tags.' \
167-
'Does the repository exist on Quay.io?' \
168-
'Quay.io REST API response was:' \
169-
"${response}"
170-
exit 1
171-
}
156+
skopeo list-tags docker://quay.io/bioconda/${{ steps.build.outputs.image }} \
157+
| jq -r '.Tags[]'
158+
)" \
159+
|| {
160+
echo 'Could not list tags via skopeo.'
161+
exit 1
162+
}
172163
for tag in ${{ steps.build.outputs.tags }} ; do
173164
case "${tag}" in
174165
latest | '${{ env.MAJOR_VERSION }}' ) ;;

.github/workflows/base-glibc-debian-bash.yaml

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -140,25 +140,16 @@ jobs:
140140
141141
- name: Check Tags
142142
run: |
143-
# FIX upstream: Quay.io does not support immutable images currently.
144-
# => Try to use the REST API to check for duplicate tags.
145-
response="$(
146-
curl -sL \
147-
'https://quay.io/api/v1/repository/bioconda/${{ steps.build.outputs.image }}/tag/'
148-
)"
149-
143+
# Quay.io does not support immutable images.
144+
# => Check for duplicate tags to avoid overwriting existing images.
150145
existing_tags="$(
151-
printf %s "${response}" \
152-
| jq -r '.tags[]|select(.end_ts == null or .end_ts >= now)|.name'
153-
)" \
154-
|| {
155-
printf %s\\n \
156-
'Could not get list of image tags.' \
157-
'Does the repository exist on Quay.io?' \
158-
'Quay.io REST API response was:' \
159-
"${response}"
160-
exit 1
161-
}
146+
skopeo list-tags docker://quay.io/bioconda/${{ steps.build.outputs.image }} \
147+
| jq -r '.Tags[]'
148+
)" \
149+
|| {
150+
echo 'Could not list tags via skopeo.'
151+
exit 1
152+
}
162153
for tag in ${{ steps.build.outputs.tags }} ; do
163154
case "${tag}" in
164155
latest | '${{ env.MAJOR_VERSION }}' ) ;;

.github/workflows/bioconda-recipes-issue-responder.yaml

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,25 +54,16 @@ jobs:
5454
5555
- name: Check Tags
5656
run: |
57-
# FIX upstream: Quay.io does not support immutable images currently.
58-
# => Try to use the REST API to check for duplicate tags.
59-
respone="$(
60-
curl -sL \
61-
'https://quay.io/api/v1/repository/bioconda/${{ steps.buildah-build.outputs.image }}/image'
62-
)"
63-
57+
# Quay.io does not support immutable images.
58+
# => Check for duplicate tags to avoid overwriting existing images.
6459
existing_tags="$(
65-
printf %s "${respone}" \
66-
| jq -r '.images[].tags[]'
67-
)" \
68-
|| {
69-
printf %s\\n \
70-
'Could not get list of image tags.' \
71-
'Does the repository exist on Quay.io?' \
72-
'Quay.io REST API response was:' \
73-
"${respone}"
74-
exit 1
75-
}
60+
skopeo list-tags docker://quay.io/bioconda/${{ steps.buildah-build.outputs.image }} \
61+
| jq -r '.Tags[]'
62+
)" \
63+
|| {
64+
echo 'Could not list tags via skopeo.'
65+
exit 1
66+
}
7667
for tag in ${{ steps.buildah-build.outputs.tags }} ; do
7768
if [ \! "${tag}" = latest ] ; then
7869
if printf %s "${existing_tags}" | grep -qxF "${tag}" ; then

.github/workflows/bot.yaml

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -89,25 +89,16 @@ jobs:
8989
9090
- name: Check Tags
9191
run: |
92-
# FIX upstream: Quay.io does not support immutable images currently.
93-
# => Try to use the REST API to check for duplicate tags.
94-
respone="$(
95-
curl -sL \
96-
'https://quay.io/api/v1/repository/bioconda/${{ steps.buildah-build.outputs.image }}/tag/'
97-
)"
98-
92+
# Quay.io does not support immutable images.
93+
# => Check for duplicate tags to avoid overwriting existing images.
9994
existing_tags="$(
100-
printf %s "${respone}" \
101-
| jq -r '.tags[]|select(.end_ts == null or .end_ts >= now)|.name'
102-
)" \
103-
|| {
104-
printf %s\\n \
105-
'Could not get list of image tags.' \
106-
'Does the repository exist on Quay.io?' \
107-
'Quay.io REST API response was:' \
108-
"${respone}"
109-
exit 1
110-
}
95+
skopeo list-tags docker://quay.io/bioconda/${{ steps.buildah-build.outputs.image }} \
96+
| jq -r '.Tags[]'
97+
)" \
98+
|| {
99+
echo 'Could not list tags via skopeo.'
100+
exit 1
101+
}
111102
for tag in ${{ steps.buildah-build.outputs.tags }} ; do
112103
if [ \! "${tag}" = '${{ matrix.tag }}' ] ; then
113104
if printf %s "${existing_tags}" | grep -qxF "${tag}" ; then

.github/workflows/create-env.yaml

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -105,25 +105,16 @@ jobs:
105105
106106
- name: Check Tags
107107
run: |
108-
# FIX upstream: Quay.io does not support immutable images currently.
109-
# => Try to use the REST API to check for duplicate tags.
110-
response="$(
111-
curl -sL \
112-
'https://quay.io/api/v1/repository/bioconda/${{ steps.build.outputs.image }}/tag/'
113-
)"
114-
108+
# Quay.io does not support immutable images.
109+
# => Check for duplicate tags to avoid overwriting existing images.
115110
existing_tags="$(
116-
printf %s "${response}" \
117-
| jq -r '.tags[]|select(.end_ts == null or .end_ts >= now)|.name'
118-
)" \
119-
|| {
120-
printf %s\\n \
121-
'Could not get list of image tags.' \
122-
'Does the repository exist on Quay.io?' \
123-
'Quay.io REST API response was:' \
124-
"${response}"
125-
exit 1
126-
}
111+
skopeo list-tags docker://quay.io/bioconda/${{ steps.build.outputs.image }} \
112+
| jq -r '.Tags[]'
113+
)" \
114+
|| {
115+
echo 'Could not list tags via skopeo.'
116+
exit 1
117+
}
127118
for tag in ${{ steps.build.outputs.tags }} ; do
128119
case "${tag}" in
129120
latest | '${{ env.MAJOR_VERSION }}' ) ;;

0 commit comments

Comments
 (0)