sdf
This commit is contained in:
@@ -77,23 +77,7 @@ pipeline {
|
|||||||
def endVersion = buildNumber - 3 // Para borrar hasta la versión "endVersion"
|
def endVersion = buildNumber - 3 // Para borrar hasta la versión "endVersion"
|
||||||
|
|
||||||
for (int i = startVersion; i <= endVersion; i++) {
|
for (int i = startVersion; i <= endVersion; i++) {
|
||||||
def versionToDelete = "0.0.${i}"
|
echo "Hola ${i}"
|
||||||
def fullImageNameToDelete = "${name}:${versionToDelete}"
|
|
||||||
|
|
||||||
echo "Borrando la imagen ${registry}/${fullImageNameToDelete}"
|
|
||||||
|
|
||||||
// Comando modificado para utilizar variables de Jenkins
|
|
||||||
sh """
|
|
||||||
curl -v -sSL -X DELETE "http://${registry}/v2/${fullImageNameToDelete}/manifests/\$(
|
|
||||||
curl -sSL -I \
|
|
||||||
-H "Accept: application/vnd.docker.distribution.manifest.v2+json" \
|
|
||||||
"http://${registry}/v2/${fullImageNameToDelete}/manifests/\$(
|
|
||||||
curl -sSL "http://${registry}/v2/${fullImageNameToDelete}/tags/list" | jq -r '.tags[0]'
|
|
||||||
)" \
|
|
||||||
| awk '\$1 == "Docker-Content-Digest:" { print \$2 }' \
|
|
||||||
| tr -d \$'\r' \
|
|
||||||
)"
|
|
||||||
"""
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// No olvides ejecutar la recolección de basura para liberar espacio realmente.
|
// No olvides ejecutar la recolección de basura para liberar espacio realmente.
|
||||||
|
|||||||
Reference in New Issue
Block a user