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.

44 lines
1.9 KiB

  1. Param(
  2. [ValidateSet(nanowin", "linux")] [String] [Parameter(Mandatory=$true)] $Platform,
  3. [bool] $DeleteImages = $false
  4. )
  5. $scriptPath = Split-Path $script:MyInvocation.MyCommand.Path
  6. $SourcePerPlatformDockerFilesPath = "$ScriptPath\_docker\$Platform\extradf"
  7. $TargetPerPlatformDockerFilesPath = "$ScriptPath\extradf"
  8. Write-Host "Current script directory is $scriptPath" -ForegroundColor Yellow
  9. If ($DeleteImages) {
  10. Write-Host "Deleting eShop Docker images"
  11. & "$ScriptPath\delete-images.ps1"
  12. }
  13. If (Test-Path $TargetPerPlatformDockerFilesPath) {
  14. Write-Host "Found per-platform extra Docker files. Removing..."
  15. Remove-Item "$TargetPerPlatformDockerFilesPath\" -Recurse -Force
  16. }
  17. If (Test-Path $SourcePerPlatformDockerFilesPath) {
  18. Write-Host "Copying per-platform extra Dockerfiles"
  19. Copy-Item "$SourcePerPlatformDockerFilesPath\*" "$ScriptPath\extradf\" -Recurse -Force
  20. }
  21. else {
  22. Write-Host "There are not extra Dockerfiles for platform $Platform"
  23. }
  24. Write-Host "Changing Dockerfiles"
  25. Copy-Item "$ScriptPath\src\Services\Basket\Basket.API\Dockerfile.$Platform" "$ScriptPath\src\Services\Basket\Basket.API\Dockerfile" -Force
  26. Copy-Item "$ScriptPath\src\Services\Catalog\Catalog.API\Dockerfile.$Platform" "$ScriptPath\src\Services\Catalog\Catalog.API\Dockerfile" -Force
  27. Copy-Item "$ScriptPath\src\Services\Identity\Identity.API\Dockerfile.$Platform" "$ScriptPath\src\Services\Identity\Identity.API\Dockerfile" -Force
  28. Copy-Item "$ScriptPath\src\Services\Ordering\Ordering.API\Dockerfile.$Platform" "$ScriptPath\src\Services\Ordering\Ordering.API\Dockerfile" -Force
  29. Copy-Item "$ScriptPath\src\Web\WebMVC\Dockerfile.$Platform" "$ScriptPath\src\Web\WebMVC\Dockerfile" -Force
  30. Copy-Item "$ScriptPath\src\Web\WebSPA\Dockerfile.$Platform" "$ScriptPath\src\Web\WebSPA\Dockerfile" -Force
  31. Write-Host "Replacing Docker-compose"
  32. Copy-Item "$ScriptPath\_docker\$Platform\*.yml" "$ScriptPath\" -Force
  33. Write-Host "Done. Docker files are set for platform: $Platform"