Skip to content

Commit

Permalink
Update pagos-qa.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Francotorrico authored Apr 16, 2024
1 parent dd3e365 commit fff2c0f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/pagos-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,20 @@ jobs:
key: ${{ env.SSH_PRIVATE_KEY }}
script: |
cd /opt/ms-pagos-qa-app
# Obtener el ID del contenedor en ejecución
CONTAINER_ID=$(docker ps -qf "name=pagosimagen")
# Si hay un contenedor en ejecución, detenerlo
if [ ! -z "$CONTAINER_ID" ]; then
docker stop $CONTAINER_ID
docker rm $CONTAINER_ID
sleep 5
echo "Contenedor existente detenido."
fi
# Eliminar imágenes antiguas si existen
if docker images -q pagosimagen; then
docker rmi -f pagosimagen
fi
# Construir la imagen
docker build -t pagosimagen .
# Eliminar imágenes sin etiqueta
docker rmi $(docker images -f "dangling=true" -q) || true
Expand Down

0 comments on commit fff2c0f

Please sign in to comment.