Skip to content

Commit

Permalink
Merge pull request #2159 from manekenpix/fix-deploy-script
Browse files Browse the repository at this point in the history
Fix: Remove remaining volumes/images/contaniers in every deployment
  • Loading branch information
manekenpix authored Apr 17, 2021
2 parents 802e1bd + cfc82eb commit c6c51cb
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions tools/autodeployment/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,9 @@ docker volume prune -f
echo "Starting $ENV Environment"
docker-compose --env-file $ENV_FILE --project-name=$ENV up -d

# Will fail on final container
# this is anticipated and doesn't affect new environment
echo "Deleting $OLD Containers"
docker rmi $(docker images $OLD\_* -aq ) -f 2> /dev/null

# Delete all older containers which were build artifacts.
# On dev environment, this should reduce all usage by min ~20%
docker rmi $(docker images -a | grep "^<none>" | awk '{print $3}') 2> /dev/null
echo "Removing dangling images"
docker rmi $(docker images -f "dangling=true" -q)


echo "Removing $OLD Environment"
docker rmi $(docker images $OLD\_* -aq ) -f 2> /dev/null

0 comments on commit c6c51cb

Please sign in to comment.