user=
pswd=
url=
proid=

REPOS=$(curl -s -X GET --header 'Accept: application/json' "${url}/api/repositories?project_id=${proid}"|grep "name"|awk -F '"' '{print $4}')

for rp in ${REPOS}
do
  TAGS=$(curl -s -X GET --header 'Accept: application/json' "${url}/api/repositories/${rp}/tags"|grep \"name\"|awk -F '"' '{print $4}')
    for t in ${TAGS}
    do
        curl -u "${user}:${pswd}" -X DELETE -H "Content-Type: application/json" "${url}/api/repositories/${rp}/tags/${t}"
        echo ${URL}"/"${rp}":"${t} >> /app/container/docker.tag
    done
  echo "删除 ===> ${URL}\/${rp}\/${t}"
done

相关文章:

  • 2022-12-23
  • 2021-07-07
  • 2021-12-14
  • 2021-07-24
  • 2021-07-09
  • 2022-01-01
  • 2022-02-21
  • 2022-12-23
猜你喜欢
  • 2021-09-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案