This commit is contained in:
Ramón Tomás 2017-08-27 23:05:47 +02:00
commit 789d7e4ed1
3 changed files with 49 additions and 4 deletions

View File

@ -16,7 +16,6 @@ declare -a projectList=(
"$path/Services/Location/Locations.API" "$path/Services/Location/Locations.API"
"$path/Services/Marketing/Marketing.API" "$path/Services/Marketing/Marketing.API"
"$path/Services/Payment/Payment.API" "$path/Services/Payment/Payment.API"
"$path/Services/GracePeriod/GracePeriodManager"
"$path/Web/WebMVC" "$path/Web/WebMVC"
"$path/Web/WebStatus" "$path/Web/WebStatus"
) )
@ -32,9 +31,9 @@ do
pushd $path/$project pushd $path/$project
rm -rf obj/Docker/publish rm -rf obj/Docker/publish
echo -e "\e[33m\tRestoring project $project" echo -e "\e[33m\tRestoring project $project"
dotnet restore dotnet restore --verbosity minimal
echo -e "\e[33m\tBuilding and publishing $project" echo -e "\e[33m\tBuilding and publishing $project"
dotnet publish -o obj/Docker/publish dotnet publish -c Release -o obj/Docker/publish --verbosity minimal
popd popd
done done

View File

@ -0,0 +1,46 @@
# Delete all containers
Write-Host "Deleting all running containers in the local Docker Host"
docker rm $(docker ps -a -q) -f
$eShopImagesToDelete = docker images --filter=reference="eshop/*" -q
If (-Not $eShopImagesToDelete) {Write-Host "Not deleting eShop images as there are no eShop images in the current local Docker repo."}
Else
{
# Delete all eshop images
Write-Host "Deleting eShop images in local Docker repo"
Write-Host $eShopImagesToDelete
docker rmi $(docker images --filter=reference="eshop/*" -q) -f
}
$VSImagesToDelete = docker images --filter=reference="catalog.api:dev" -q
If (-Not $VSImagesToDelete) {Write-Host "Not deleting VS images as there are no VS images in the current local Docker repo."}
Else
{
# Delete all eshop images
Write-Host "Deleting images created by VS in local Docker repo"
Write-Host $VSImagesToDelete
docker rmi $(docker images --filter=reference="*:dev" -q) -f
#docker rmi $(docker images --filter=reference="eshop/payment.api:dev" -q) -f
#docker rmi $(docker images --filter=reference="eshop/webspa:dev" -q) -f
#docker rmi $(docker images --filter=reference="eshop/webmvc:dev" -q) -f
#docker rmi $(docker images --filter=reference="eshop/catalog.api:dev" -q) -f
#docker rmi $(docker images --filter=reference="eshop/marketing.api:dev" -q) -f
#docker rmi $(docker images --filter=reference="eshop/ordering.api:dev" -q) -f
#docker rmi $(docker images --filter=reference="eshop/basket.api:dev" -q) -f
#docker rmi $(docker images --filter=reference="eshop/identity.api:dev" -q) -f
#docker rmi $(docker images --filter=reference="eshop/locations.api:dev" -q) -f
#docker rmi $(docker images --filter=reference="eshop/webstatus:dev" -q) -f
}
# DELETE ALL IMAGES AND CONTAINERS
# Delete all containers
# docker rm $(docker ps -a -q) -f
# Delete all images
# docker rmi $(docker images -q)
#Filter by image name (Has to be complete, cannot be a wildcard)
#docker ps -q --filter=ancestor=eshop/identity.api:dev

View File

@ -11,7 +11,7 @@ services:
# Next line is using the .sln file to compile all the projects. # Next line is using the .sln file to compile all the projects.
# Sometime there is an issue in msbuild exits the process before finishing building the bits: (https://github.com/Microsoft/msbuild/issues/2153) # Sometime there is an issue in msbuild exits the process before finishing building the bits: (https://github.com/Microsoft/msbuild/issues/2153)
# Random error: error MSB4017: The build stopped unexpectedly be cause of an unexpected logger failure. # Random error: error MSB4017: The build stopped unexpectedly be cause of an unexpected logger failure.
#command: /bin/bash -c "pushd ./src/Web/WebSPA && npm rebuild node-sass && popd && dotnet restore ./eShopOnContainers-ServicesAndWebApps.sln && dotnet publish ./eShopOnContainers-ServicesAndWebApps.sln -c Release -o ./obj/Docker/publish" #command: /bin/bash -c "pushd ./src/Web/WebSPA && npm rebuild node-sass && popd && dotnet restore ./eShopOnContainers-ServicesAndWebApps.sln --verbosity minimal && dotnet publish ./eShopOnContainers-ServicesAndWebApps.sln -c Release -o ./obj/Docker/publish --verbosity minimal"
# NOTE: Using build-bits-linux.sh from Linux build container exits before ending. # NOTE: Using build-bits-linux.sh from Linux build container exits before ending.
command: /bin/bash -c "pushd ./src/Web/WebSPA && npm rebuild node-sass && popd && pushd /cli-linux && ./build-bits-linux.sh /src" command: /bin/bash -c "pushd ./src/Web/WebSPA && npm rebuild node-sass && popd && pushd /cli-linux && ./build-bits-linux.sh /src"