update build script for Mac
Until adding these, the project would not build correctly on a Mac. script working for SPA Add execute permissions to build-bits.sh on macOS fix a rebase / automatic merge issue. Somehow, the MVC image got in there twice. update content nodes Bug workaround for for the CLI. It turns out that the CLI does not handle content nodes that have multiple paths. Instead, multiple nodes are needed. use the standard names for the web docker images. fix a typo and update the csproj content listings. Also, execute nom install as part of publishing the spa application.
This commit is contained in:
parent
2f54214785
commit
bb5d48735d
43
build-bits.sh
Normal file → Executable file
43
build-bits.sh
Normal file → Executable file
@ -1,12 +1,35 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#dotnet restore
|
|
||||||
rm -rf ./pub
|
|
||||||
dotnet publish "$(pwd)/src/Web/WebMVC/project.json" -o "$(pwd)/pub/webMVC"
|
|
||||||
dotnet publish "$(pwd)/src/Services/Catalog/Catalog.API/project.json" -o "$(pwd)/pub/catalog"
|
|
||||||
dotnet publish "$(pwd)/src/Services/Ordering/Ordering.API/project.json" -o "$(pwd)/pub/ordering"
|
|
||||||
dotnet publish "$(pwd)/src/Services/Basket/Basket.API/project.json" -o "$(pwd)/pub/basket"
|
|
||||||
|
|
||||||
docker build -t eshop/web "$(pwd)/pub/webMVC"
|
projectList=(
|
||||||
docker build -t eshop/catalog.api "$(pwd)/pub/catalog"
|
"src/Services/Catalog/Catalog.API"
|
||||||
docker build -t eshop/ordering.api "$(pwd)/pub/ordering"
|
"src/Services/Basket/Basket.API"
|
||||||
docker build -t eshop/basket.api "$(pwd)/pub/basket"
|
"src/Services/Ordering/Ordering.API"
|
||||||
|
"src/Services/Identity/Identity.API"
|
||||||
|
"src/Web/WebMVC"
|
||||||
|
"src/Web/WebSPA/eShopOnContainers.WebSPA"
|
||||||
|
)
|
||||||
|
|
||||||
|
for project in "${projectList[@]}"
|
||||||
|
do
|
||||||
|
echo -e "\e[33mWorking on $(pwd)/$project"
|
||||||
|
echo -e "\e[33m\tRemoving old publish output"
|
||||||
|
pushd $(pwd)/$project
|
||||||
|
rm -rf obj/Docker/publish
|
||||||
|
echo -e "\e[33m\tRestoring project"
|
||||||
|
dotnet restore
|
||||||
|
echo -e "\e[33m\tBuilding and publishing projects"
|
||||||
|
dotnet publish -o obj/Docker/publish
|
||||||
|
popd
|
||||||
|
done
|
||||||
|
|
||||||
|
# remove old docker images:
|
||||||
|
images=$(docker images --filter=reference="eshop/*" -q)
|
||||||
|
if [ -n "$images" ]; then
|
||||||
|
docker rm $(docker ps -a -q) -f
|
||||||
|
echo "Deleting eShop images in local Docker repo"
|
||||||
|
echo $images
|
||||||
|
docker rmi $(docker images --filter=reference="eshop/*" -q) -f
|
||||||
|
fi
|
||||||
|
|
||||||
|
# No need to build the images, docker build or docker compose will
|
||||||
|
# do that using the images and containers defined in the docker-compose.yml file.
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
version: '2'
|
version: '2'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
basket.api:
|
basket.api:
|
||||||
environment:
|
environment:
|
||||||
- ASPNETCORE_ENVIRONMENT=Development
|
- ASPNETCORE_ENVIRONMENT=Development
|
||||||
- ConnectionString=basket.data
|
- ConnectionString=basket.data
|
||||||
#- identityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105.
|
#- identityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105.
|
||||||
- identityUrl=http://10.0.75.1:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
|
- identityUrl=http://identity.api:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
|
||||||
ports:
|
ports:
|
||||||
- "5103:5103"
|
- "5103:5103"
|
||||||
|
|
||||||
@ -15,18 +16,17 @@ services:
|
|||||||
- ASPNETCORE_ENVIRONMENT=Development
|
- ASPNETCORE_ENVIRONMENT=Development
|
||||||
- ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word
|
- ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word
|
||||||
#- ExternalCatalogBaseUrl=http://13.88.8.119:5101 #Remote: VM Needs to have public access at 5105.
|
#- ExternalCatalogBaseUrl=http://13.88.8.119:5101 #Remote: VM Needs to have public access at 5105.
|
||||||
- ExternalCatalogBaseUrl=http://10.0.75.1:5101 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
|
- ExternalCatalogBaseUrl=http://localhost:5101 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
|
||||||
ports:
|
ports:
|
||||||
- "5101:5101"
|
- "5101:5101"
|
||||||
|
|
||||||
|
|
||||||
identity.api:
|
identity.api:
|
||||||
environment:
|
environment:
|
||||||
- ASPNETCORE_ENVIRONMENT=Development
|
- ASPNETCORE_ENVIRONMENT=Development
|
||||||
- SpaClient=http://localhost:5104
|
- SpaClient=http://localhost:5104
|
||||||
- ConnectionStrings__DefaultConnection=Server=sql.data;Database=Microsoft.eShopOnContainers.Service.IdentityDb;User Id=sa;Password=Pass@word
|
- ConnectionStrings__DefaultConnection=Server=sql.data;Database=Microsoft.eShopOnContainers.Service.IdentityDb;User Id=sa;Password=Pass@word
|
||||||
#- MvcClient=http://13.88.8.119:5100 #Remote: VM Needs to have public access at 5105.
|
#- MvcClient=http://13.88.8.119:5100 #Remote: VM Needs to have public access at 5105.
|
||||||
- MvcClient=http://10.0.75.1:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105.
|
- MvcClient=http://localhost:5100 #Local: You need to open your local dev-machine firewall at range 5100-5105.
|
||||||
ports:
|
ports:
|
||||||
- "5105:5105"
|
- "5105:5105"
|
||||||
|
|
||||||
@ -35,18 +35,18 @@ services:
|
|||||||
- ASPNETCORE_ENVIRONMENT=Development
|
- ASPNETCORE_ENVIRONMENT=Development
|
||||||
- ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word
|
- ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word
|
||||||
#- identityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105.
|
#- identityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105.
|
||||||
- identityUrl=http://10.0.75.1:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
|
- identityUrl=http://identity.api:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
|
||||||
ports:
|
ports:
|
||||||
- "5102:5102"
|
- "5102:5102"
|
||||||
|
|
||||||
eshoponcontainers.webspa:
|
webspa:
|
||||||
environment:
|
environment:
|
||||||
- ASPNETCORE_ENVIRONMENT=Development
|
- ASPNETCORE_ENVIRONMENT=Development
|
||||||
- CatalogUrl=http://10.0.75.1:5101
|
- CatalogUrl=http://localhost:5101
|
||||||
- OrderingUrl=http://10.0.75.1:5102
|
- OrderingUrl=http://localhost:5102
|
||||||
#- IdentityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105.
|
#- IdentityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105.
|
||||||
- IdentityUrl=http://10.0.75.1:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
|
- IdentityUrl=http://localhost:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
|
||||||
- BasketUrl=http://10.0.75.1:5103
|
- BasketUrl=http://localhost:5103
|
||||||
ports:
|
ports:
|
||||||
- "5104:5104"
|
- "5104:5104"
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ services:
|
|||||||
- CatalogUrl=http://catalog.api:5101
|
- CatalogUrl=http://catalog.api:5101
|
||||||
- OrderingUrl=http://ordering.api:5102
|
- OrderingUrl=http://ordering.api:5102
|
||||||
#- IdentityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105.
|
#- IdentityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105.
|
||||||
- IdentityUrl=http://10.0.75.1:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
|
- IdentityUrl=http://identity.api:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
|
||||||
- BasketUrl=http://basket.api:5103
|
- BasketUrl=http://basket.api:5103
|
||||||
ports:
|
ports:
|
||||||
- "5100:5100"
|
- "5100:5100"
|
||||||
|
@ -34,8 +34,8 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- sql.data
|
- sql.data
|
||||||
|
|
||||||
eshoponcontainers.webspa:
|
webspa:
|
||||||
image: eshop/eshoponcontainers.webspa
|
image: eshop/webspa
|
||||||
build:
|
build:
|
||||||
context: ./src/Web/WebSPA/eShopOnContainers.WebSPA
|
context: ./src/Web/WebSPA/eShopOnContainers.WebSPA
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
@ -13,7 +13,10 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Update="wwwroot;Views;Areas\**\Views;appsettings.json;web.config;Dockerfile;docker-compose.yml;.dockerignore">
|
<Content Update="web.config">
|
||||||
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include=".dockerignore">
|
||||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -13,12 +13,20 @@
|
|||||||
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Update="wwwroot;Pics\**\*;Views;Areas\**\Views;settings.json;web.config;project.json;Dockerfile">
|
<Content Update="wwwroot;">
|
||||||
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="Pics\**\*;">
|
||||||
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="web.config;">
|
||||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.1.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.1.0" />
|
||||||
|
@ -14,7 +14,16 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Update="wwwroot\**\*;Views\**\*;Areas\**\Views;appsettings.json;web.config;Dockerfile;docker-compose.yml;.dockerignore">
|
<Content Update="wwwroot;">
|
||||||
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Views\**\*;">
|
||||||
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="web.config;">
|
||||||
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include=".dockerignore">
|
||||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -14,7 +14,10 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Update="wwwroot;Views;Areas\**\Views;settings.json;web.config;docker-compose.yml;docker-compose.debug.yml;Dockerfile.debug;Dockerfile;.dockerignore">
|
<Content Update="web.config;">
|
||||||
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include=".dockerignore;">
|
||||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -14,7 +14,19 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Update="wwwroot\**\*;Views\**\*;Areas\**\Views;appsettings.json;appsettings.override.json;web.config;Dockerfile;docker-compose.yml;.dockerignore">
|
<Content Update="wwwroot\**\*;">
|
||||||
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Views\**\*;">
|
||||||
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="appsettings.json;">
|
||||||
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="web.config">
|
||||||
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update=".dockerignore">
|
||||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -17,7 +17,25 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Remove="node_modules\**\*;Client\**\*" />
|
<Compile Remove="node_modules\**\*;Client\**\*" />
|
||||||
<Content Update="appsettings.json;Client\**\*;typings;Views\**\*;tsconfig.json;tsd.json;web.config;config\**\*;wwwroot\**\*;dockerfile">
|
<Content Update="appsettings.json;">
|
||||||
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Client\**\*;">
|
||||||
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Views\**\*;">
|
||||||
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="tsconfig.json;">
|
||||||
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="web.config;">
|
||||||
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="config\**\*;">
|
||||||
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="wwwroot\**\*;">
|
||||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
@ -50,6 +68,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
|
<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
|
||||||
|
<Exec Command="npm install" />
|
||||||
<Exec Command="npm run build:prod" />
|
<Exec Command="npm run build:prod" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user