1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
| cd "D:\Git\workspace\mywebsite\Admin.NET" dotnet publish -p:PublishDir=D:\Git\publish\mywebsite --arch x64 $website="mywebsiteApiNew" $sourceFolder='D:\Git\publish\mywebsite' $url="10.10.0.3" $port="8100" $username="test" $password="123123" $webDeployFolder='C:\Program Files\IIS\Microsoft Web Deploy V3' $msdeploy=Join-Path -Path $webDeployFolder -ChildPath "msdeploy.exe" $scriptFolder=Join-Path -Path $webDeployFolder -ChildPath "Scripts" cd "$scriptFolder" . .\BackupScripts.ps1
TurnOn-Backups -On $true
Configure-Backups -Enabled $true
Configure-Backups -SiteName "$website" -Enabled $true
Configure-Backups -BackupPath "{SitePathParent}\{siteName}_snapshots"
Configure-Backups -NumberOfBackups 8
Configure-Backups -ContinueSyncOnBackupFailure $false
Configure-Backups -AddExcludedProviders @("dbmysql","dbfullsql")
& $msdeploy -verb:sync -allowUntrusted -source:recycleApp -dest:recycleApp="$website",recycleMode="StopAppPool",computerName="https://${url}:${port}/msdeploy.axd?site=$website",username="$username",password="$password",AuthType="Basic"
& $msdeploy -verb:sync -allowUntrusted -source:contentPath=$sourceFolder -dest:contentPath="$website/",computerName="https://${url}:${port}/msdeploy.axd?site=$website",username="$username",password="$password",AuthType="Basic" -skip:objectName=dirPath,absolutePath='Configuration' -skip:objectName=dirPath,absolutePath='logs'
& $msdeploy -verb:sync -allowUntrusted -source:recycleApp -dest:recycleApp="$website",recycleMode="StartAppPool",computerName="https://${url}:${port}/msdeploy.axd?site=$website",username="$username",password="$password",AuthType="Basic"
$baseDir="D:\Git\workspace\mywebsite\Web" & cd $baseDir & yarn build $sourceFolder=Join-Path -Path $baseDir -ChildPath "dist" $webSiteFolder="D:\WebSite\mywebsiteNew" $webSiteFolder $destFolder=Join-Path -Path $webSiteFolder -ChildPath "web" $destFolder $backFolder=Join-Path -Path $webSiteFolder -ChildPath "web_back" $backFolder $now=Get-Date -Format "yyyy-MM-dd_HHmmss" $backFileName=-join ($now,".zip") $fullFolder=Join-Path -Path $backFolder -ChildPath $backFileName Compress-Archive -Path $destFolder -DestinationPath $fullFolder -Force $removeFolder=-join($destFolder,"\*") Remove-Item $removeFolder -Recurse -Force $fullSourceFolder=-join ($sourceFolder,"\*") Copy-Item -Path $fullSourceFolder -Destination $destFolder -Recurse
|