1 Star 0 Fork 0

qianqing9827/eShopOnDapr

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Create-DockerfileSolutionRestore.ps1 1.17 KB
一键复制 编辑 原始数据 按行查看 历史
Sander Molenkamp 提交于 2020-10-27 09:56 . Improve debug experience
param (
[string]$solution = "eShop-Learn.sln"
)
$outfile = "DockerfileSolutionRestore.txt"
# This script creates the $outfile file, with Dockerfile commands to restore all the packages for the solution,
# so you can insert them (by hand) into Dockerfiles right before the "COPY . ." line
# to increase build speed by optimizing the use of docker build images cache.
# This script is only needed when adding or removing projects from the solution.
Write-Output "" > $outfile
Add-Content -Path $outfile "# Create this ""restore-solution"" section by running ./Create-DockerfileSolutionRestore.ps1, to optimize build cache reuse"
Select-String -Path $solution -Pattern ', "(.*?\.csproj)"' | ForEach-Object { $_.Matches.Groups[1].Value.Replace("\", "/") } | Sort-Object | ForEach-Object {"COPY [""$_"", """ + $_.Substring(0, $_.LastIndexOf("/") + 1) + """]"} | Out-File -FilePath $outfile -Append
Add-Content -Path $outfile "COPY [""docker-compose.dcproj"", ""./""]"
Add-Content -Path $outfile "COPY [""NuGet.config"", ""./""]"
Add-Content -Path $outfile "COPY [""$solution"", ""./""]"
Add-Content -Path $outfile "RUN dotnet restore ""$solution"""
Add-Content -Path $outfile ""
Get-Content $outfile
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/qianqing9827/eShopOnDapr.git
git@gitee.com:qianqing9827/eShopOnDapr.git
qianqing9827
eShopOnDapr
eShopOnDapr
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385