8714-devToTest #1547

Merged
alexm merged 712 commits from 8714-devToTest into test 2025-03-04 14:08:01 +00:00
1 changed files with 2 additions and 23 deletions
Showing only changes of commit 79e2a7ee25 - Show all commits

25
Jenkinsfile vendored
View File

@ -178,30 +178,9 @@ def cleanDockerE2E() {
script {
def projectBranch = "${PROJECT_NAME}-${env.BRANCH_NAME}".toLowerCase()
// STOP AND REMOVE
def containers = sh(script: """
docker ps --filter "name=^${projectBranch}" --format "{{.ID}}"
""", returnStdout: true).trim()
sh """docker ps -a --filter "name=^${projectBranch}" | awk 'NR>1 {print $1}' | xargs -r docker rm -v || true"""
sh """docker network ls --filter "name=^${projectBranch}" | awk 'NR>1 {print $1}' | xargs -r docker network rm || true"""
if (containers) {
sh(script: """
echo '${containers}' | xargs docker stop
echo '${containers}' | xargs docker rm
""")
} else {
echo "No se encontraron contenedores con el prefijo '${projectBranch}'."
}
def networks = sh(script: """
docker network ls --filter "name=^${projectBranch}" --format "{{.ID}}"
""", returnStdout: true).trim()
if (networks) {
sh(script: """
echo '${networks}' | xargs docker network rm
""")
} else {
echo "No se encontraron redes con el prefijo '${projectBranch}'."
}
}
}