You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.0 KiB

8 years ago
  1. #!/bin/sh
  2. projectList=(
  3. "../src/Services/Catalog/Catalog.API"
  4. "../src/Services/Basket/Basket.API"
  5. "../src/Services/Ordering/Ordering.API"
  6. "../src/Services/Identity/Identity.API"
  7. "../src/Web/WebMVC"
  8. "../src/Web/WebSPA"
  9. "../src/Web/WebStatus"
  10. )
  11. for project in "${projectList[@]}"
  12. do
  13. echo -e "\e[33mWorking on $(pwd)/$project"
  14. echo -e "\e[33m\tRemoving old publish output"
  15. pushd $(pwd)/$project
  16. rm -rf obj/Docker/publish
  17. echo -e "\e[33m\tRestoring project"
  18. dotnet restore
  19. echo -e "\e[33m\tBuilding and publishing projects"
  20. dotnet publish -o obj/Docker/publish
  21. popd
  22. done
  23. # remove old docker images:
  24. images=$(docker images --filter=reference="eshop/*" -q)
  25. if [ -n "$images" ]; then
  26. docker rm $(docker ps -a -q) -f
  27. echo "Deleting eShop images in local Docker repo"
  28. echo $images
  29. docker rmi $(docker images --filter=reference="eshop/*" -q) -f
  30. fi
  31. # No need to build the images, docker build or docker compose will
  32. # do that using the images and containers defined in the docker-compose.yml file.