deploy.ps1 1.2 KB

12345678910111213141516171819202122232425262728
  1. param ($deploymentProfile, $deploymentPassword)
  2. # This is the version used in the https://doc.stride3d.net/<version> url
  3. # Please update this if branching for a new release!
  4. $version = "4.0"
  5. # Deploy doc on the target
  6. Write-Host Executing `'WAWSDeploy.exe ../stride_doc.zip $deploymentProfile /v /t $version /d /p XXXXXXXXXXXXX`'
  7. ./WAWSDeploy.exe ../stride_doc.zip $deploymentProfile /v /t $version /d /p $deploymentPassword
  8. # Process versions.json
  9. Write-Host Updating list of versions
  10. $response = Invoke-RestMethod -Uri http://xenko-doc.azurewebsites.net/versions.json
  11. $response.versions = ($response.versions + $version) | select -Unique | Sort-Object -Property @{Expression={ new-object System.Version ($_) }; Descending = $True}
  12. # Save file
  13. New-Item -Name "_siteroot" -ItemType "directory"
  14. $response | ConvertTo-Json | Out-File -Encoding ascii "_siteroot/versions.json"
  15. # Only update web.config if we are the latest version
  16. if ($response.versions[0] -eq $version)
  17. {
  18. (Get-Content -path "web.config" -Raw) -Replace '%deployment_version%', $version | Set-Content -Encoding utf8 -Path "_siteroot\web.config"
  19. }
  20. # Upload versions.json and web.config
  21. ./WAWSDeploy.exe _siteroot $deploymentProfile /v /p $deploymentPassword
  22. Remove-Item "_siteroot" -Recurse