Skip to content

Commit 34a8ad3

Browse files
committed
Merge branch 'netcore2' into dev
# Conflicts: # cli-linux/build-bits-linux.sh # docker-compose.ci.build.yml # src/Services/Location/Locations.API/Dockerfile.nanowin # src/Services/Marketing/Marketing.API/Dockerfile.nanowin # src/Services/Payment/Payment.API/Dockerfile.nanowin # src/Web/WebStatus/Dockerfile.nanowin
2 parents 3db84ea + 6fd4f46 commit 34a8ad3

186 files changed

Lines changed: 2584 additions & 3023 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP=10.121.122.92
2121
#ESHOP_AZURE_STORAGE_CATALOG_KEY=<YourAzureStorageCatalogKey>
2222
#ESHOP_AZURE_STORAGE_MARKETING_NAME=<YourAzureStorageMarketingName>
2323
#ESHOP_AZURE_STORAGE_MARKETING_KEY=<YourAzureStorageMarketingKey>
24+
#ESHOP_SERVICE_BUS_USERNAME=<ServiceBusUserName-OnlyUsedIfUsingRabbitMQUnderwindows>
25+
#ESHOP_SERVICE_BUS_PASSWORD=<ServiceBusUserPassword-OnlyUsedIfUsingRabbitMQUnderwindows>

cli-linux/build-bits-linux.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ declare -a projectList=(
1616
"$path/Services/Location/Locations.API"
1717
"$path/Services/Marketing/Marketing.API"
1818
"$path/Services/Payment/Payment.API"
19-
"$path/Services/GracePeriod/GracePeriodManager"
2019
"$path/Web/WebMVC"
2120
"$path/Web/WebStatus"
2221
)
@@ -34,7 +33,7 @@ do
3433
echo -e "\e[33m\tRestoring project $project"
3534
dotnet restore --verbosity minimal
3635
echo -e "\e[33m\tBuilding and publishing $project"
37-
dotnet publish -c Release -o obj/Docker/publish --verbosity minimal
36+
dotnet publish -c Release -o obj/Docker/publish --verbosity minimal
3837
popd
3938
done
4039

cli-mac/build-bits.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ do
2525
echo -e "\e[33m\tRestoring project"
2626
dotnet restore
2727
echo -e "\e[33m\tBuilding and publishing projects"
28-
dotnet publish -o obj/Docker/publish
28+
dotnet publish -o obj/Docker/publish -c Release
2929
popd
3030
done
3131

cli-windows/build-bits.ps1

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,35 @@ if ([string]::IsNullOrEmpty($rootPath)) {
88
}
99
Write-Host "Root path used is $rootPath" -ForegroundColor Yellow
1010

11+
workflow BuildAndPublish {
12+
param ([string] $rootPath
13+
)
1114
$projectPaths =
1215
@{Path="$rootPath\src\Web\WebMVC";Prj="WebMVC.csproj"},
1316
@{Path="$rootPath\src\Web\WebSPA";Prj="WebSPA.csproj"},
1417
@{Path="$rootPath\src\Services\Identity\Identity.API";Prj="Identity.API.csproj"},
1518
@{Path="$rootPath\src\Services\Catalog\Catalog.API";Prj="Catalog.API.csproj"},
1619
@{Path="$rootPath\src\Services\Ordering\Ordering.API";Prj="Ordering.API.csproj"},
1720
@{Path="$rootPath\src\Services\Basket\Basket.API";Prj="Basket.API.csproj"},
18-
@{Path="$rootPath\src\Services\GracePeriod\GracePeriodManager";Prj="GracePeriodManager.csproj"},
1921
@{Path="$rootPath\src\Services\Location\Locations.API";Prj="Locations.API.csproj"},
2022
@{Path="$rootPath\src\Services\Marketing\Marketing.API";Prj="Marketing.API.csproj"},
2123
@{Path="$rootPath\src\Services\Payment\Payment.API";Prj="Payment.API.csproj"},
2224
@{Path="$rootPath\src\Web\WebStatus";Prj="WebStatus.csproj"}
2325

24-
$projectPaths | foreach {
25-
$projectPath = $_.Path
26-
$projectFile = $_.Prj
27-
$outPath = $_.Path + "\obj\Docker\publish"
28-
$projectPathAndFile = "$projectPath\$projectFile"
29-
Write-Host "Deleting old publish files in $outPath" -ForegroundColor Yellow
30-
remove-item -path $outPath -Force -Recurse -ErrorAction SilentlyContinue
31-
Write-Host "Publishing $projectPathAndFile to $outPath" -ForegroundColor Yellow
32-
dotnet restore $projectPathAndFile
33-
dotnet build $projectPathAndFile
34-
dotnet publish $projectPathAndFile -o $outPath
26+
foreach -parallel ($item in $projectPaths) {
27+
$projectPath = $item.Path
28+
$projectFile = $item.Prj
29+
$outPath = $item.Path + "\obj\Docker\publish"
30+
$projectPathAndFile = "$projectPath\$projectFile"
31+
#Write-Host "Deleting old publish files in $outPath" -ForegroundColor Yellow
32+
remove-item -path $outPath -Force -Recurse -ErrorAction SilentlyContinue
33+
#Write-Host "Publishing $projectPathAndFile to $outPath" -ForegroundColor Yellow
34+
dotnet build $projectPathAndFile
35+
dotnet publish $projectPathAndFile -o $outPath -c Release
36+
}
3537
}
3638

39+
BuildAndPublish $rootPath
3740

3841
########################################################################################
3942
# Delete old eShop Docker images
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Delete all containers
2+
Write-Host "Deleting all running containers in the local Docker Host"
3+
docker rm $(docker ps -a -q) -f
4+
5+
$eShopImagesToDelete = docker images --filter=reference="eshop/*" -q
6+
If (-Not $eShopImagesToDelete) {Write-Host "Not deleting eShop images as there are no eShop images in the current local Docker repo."}
7+
Else
8+
{
9+
# Delete all eshop images
10+
Write-Host "Deleting eShop images in local Docker repo"
11+
Write-Host $eShopImagesToDelete
12+
docker rmi $(docker images --filter=reference="eshop/*" -q) -f
13+
}
14+
15+
$VSImagesToDelete = docker images --filter=reference="catalog.api:dev" -q
16+
If (-Not $VSImagesToDelete) {Write-Host "Not deleting VS images as there are no VS images in the current local Docker repo."}
17+
Else
18+
{
19+
# Delete all eshop images
20+
Write-Host "Deleting images created by VS in local Docker repo"
21+
Write-Host $VSImagesToDelete
22+
docker rmi $(docker images --filter=reference="*:dev" -q) -f
23+
24+
#docker rmi $(docker images --filter=reference="eshop/payment.api:dev" -q) -f
25+
#docker rmi $(docker images --filter=reference="eshop/webspa:dev" -q) -f
26+
#docker rmi $(docker images --filter=reference="eshop/webmvc:dev" -q) -f
27+
#docker rmi $(docker images --filter=reference="eshop/catalog.api:dev" -q) -f
28+
#docker rmi $(docker images --filter=reference="eshop/marketing.api:dev" -q) -f
29+
#docker rmi $(docker images --filter=reference="eshop/ordering.api:dev" -q) -f
30+
#docker rmi $(docker images --filter=reference="eshop/basket.api:dev" -q) -f
31+
#docker rmi $(docker images --filter=reference="eshop/identity.api:dev" -q) -f
32+
#docker rmi $(docker images --filter=reference="eshop/locations.api:dev" -q) -f
33+
#docker rmi $(docker images --filter=reference="eshop/webstatus:dev" -q) -f
34+
}
35+
36+
# DELETE ALL IMAGES AND CONTAINERS
37+
38+
# Delete all containers
39+
# docker rm $(docker ps -a -q) -f
40+
41+
# Delete all images
42+
# docker rmi $(docker images -q)
43+
44+
#Filter by image name (Has to be complete, cannot be a wildcard)
45+
#docker ps -q --filter=ancestor=eshop/identity.api:dev
46+
Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,32 @@
1-
Param([string] $rootPath)
1+
# rootPath: Root path of the repo (where docker-compose*.yml are). If not passed ../cli-windows/ is assumed
2+
# buildBits: If the projects must be built before. Default value: $true
3+
# customEventBusLoginPassword: If a custom RabbitMQ image is used that do not use the default user login/pwd. Default: $false (means assume use default spring2/rabbitmq image)
4+
5+
Param(
6+
[parameter(Mandatory=$false)][string] $rootPath,
7+
[parameter(Mandatory=$false)][bool] $customEventBusLoginPassword=$false,
8+
[parameter(Mandatory=$false)][bool]$buildBits=$true
9+
)
10+
211
$scriptPath = Split-Path $script:MyInvocation.MyCommand.Path
312
if ([string]::IsNullOrEmpty($rootPath)) {
413
$rootPath = "$scriptPath\.."
514
}
615
Write-Host "Root path used is $rootPath" -ForegroundColor Yellow
716

8-
& .\build-bits.ps1 -rootPath $rootPath
9-
docker-compose -f "$rootPath\docker-compose-windows.yml" -f "$rootPath\docker-compose-windows.override.yml" up
17+
18+
if ($buildBits) {
19+
& $scriptPath\build-bits.ps1 -rootPath $rootPath
20+
}
21+
22+
23+
$env:ESHOP_EXTERNAL_DNS_NAME_OR_IP = "10.0.75.1"
24+
$env:ESHOP_AZURE_STORAGE_CATALOG_URL ="http://10.0.75.1:5101/api/v1/catalog/items/[0]/pic/"
25+
$env:ESHOP_AZURE_STORAGE_MARKETING_URL ="http://10.0.75.1:5110/api/v1/campaigns/[0]/pic/"
26+
27+
if (-Not $customEventBusLoginPassword) {
28+
docker-compose -f "$rootPath\docker-compose-windows.yml" -f "$rootPath\docker-compose.override.yml" -f "$rootPath\docker-compose.override.windows.yml" up
29+
}
30+
else {
31+
docker-compose -f "$rootPath\docker-compose-windows.yml" -f "$rootPath\docker-compose.override.yml" up
32+
}

docker-compose-windows.override.yml

Lines changed: 0 additions & 171 deletions
This file was deleted.

docker-compose-windows.prod.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,6 @@ services:
118118
- AzureStorageEnabled=False
119119
ports:
120120
- "5110:80"
121-
122-
graceperiodmanager:
123-
environment:
124-
- ASPNETCORE_ENVIRONMENT=Production
125-
- ASPNETCORE_URLS=http://0.0.0.0:80
126-
- ConnectionString=${ESHOP_AZURE_ORDERING_DB:-Server=sql.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word}
127-
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq}
128121

129122
sql.data:
130123
environment:

0 commit comments

Comments
 (0)