Devops self-signed sertifika olduğu için aşağıdaki git ayarını yapmak lazım. Cmd ekranından aşağıdaki komutu yazabilirsiniz
git config --global http.sslVerify false
Devops self-signed sertifika olduğu için aşağıdaki git ayarını yapmak lazım. Cmd ekranından aşağıdaki komutu yazabilirsiniz
git config --global http.sslVerify false
DECLARE @body NVARCHAR(MAX)
DECLARE @mSubject VARCHAR(MAX);
DECLARE @date DATETIME;
SET @date = CAST(CONVERT(CHAR(10), GETDATE(), 101) AS DATETIME);
SET @body = '<html><head>
<title>Email Başlık</title>
</head><body>
<table border="1" cellpadding="0" cellspacing="0" width="100%">
<tr style="text-align:left";>
<th>Plaka</th>
<th>İl</th>
<th>İlçe</th>
<th>Adres</th>
</tr>';
SET @body = @body + CAST(
(
SELECT
'td/@align' = 'left',
td = T.Plaka,
'',
'td/@align' = 'left',
td = T.IlAdi,
'',
'td/@align' = 'left',
td = T.IlceAdi,
'',
'td/@align' = 'left',
td = T.Adres,
''
From (
SELECT * FROM Adres
) T
FOR XML PATH('tr'), ELEMENTS
)
AS NVARCHAR(MAX))
SET @body = @body + '</table></body></html>';
SET @mSubject = 'Falcon - ' + CONVERT(CHAR(10), DATEADD(dd, -1, @date), 104) + ' Konumu Çekilemeyen Adresler';
EXEC msdb.dbo.sp_send_dbmail
@recipients = N'akifyanbak@mail.com',
@copy_recipients =N'cc@mail.com',
@body = @body,
@body_format = 'HTML',
@subject = @mSubject,
@profile_name = 'sql_email_profile';
Yedek alıyor, uygulamayı durduruyor, dosyaları güncelliyor, uygulamayı açıyor.
WebApi
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")){
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit
}
Write-Host "Yedekleniyor...";
$from = "C:\WebSites\akifsite.com\_Current\*"
$to = "C:\WebSites\akifsite.com\_Old\"+(get-date).ToString('yyyy_MM_dd-hh_mm_ss')+"\"
New-Item -ItemType Directory -Force -Path $to
Copy-Item $from $to -recurse
Write-Host $to " klasorune yedeklendi";
$FileName = "C:\WebSites\akifsite.com\_New\Api\web.config"
if (Test-Path $FileName) {
Remove-Item $FileName
}
$FileName = "C:\WebSites\akifsite.com\_New\Api\appsettings.json"
if (Test-Path $FileName) {
Remove-Item $FileName
}
$siteName = "akifsite.com"; #poolState name aynı diye bunu kullanıyorum, farklı olsa poolName eklemek lazım - akif 30.09.2020
$poolState="";
$siteState ="";
$currentRetry = 0;
Write-Host $siteName " durduruluyor...";
do{
$siteState = (Get-WebsiteState $siteName).Value;
$poolState = (Get-WebAppPoolState $siteName).Value
if($siteState -eq "Started"){
STOP-Website $siteName;
}
if($poolState -eq "Started"){
Stop-WebAppPool -Name $siteName;
}
if($siteState -eq "Started" -or $poolState -eq "Started"){
Start-Sleep -s 5;
}
$currentRetry = $currentRetry + 1;
}while ($siteState -eq "Started" -and $currentRetry -le 20)
Write-Host $siteName " Durdu (" $currentRetry "sn)";
Write-Host "Uygulama guncelleniyor...";
$from = "C:\WebSites\akifsite.com\_New\Api\*"
$to = "C:\WebSites\akifsite.com\_Current\Api\"
New-Item -ItemType Directory -Force -Path $to
Copy-Item $from $to -recurse
Write-Host "Uygulama guncellendi";
Write-Host $siteName " calistiriliyor.."
if($siteState -eq "Stopped"){
Start-Website $siteName;
}
if($poolState -eq "Stopped"){
Start-WebAppPool -Name $siteName;
}
Write-Host $siteName " calisiyor"
Write-Host "Bitti"
Read-Host
UiUpdate
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")){
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit
}
Write-Host "Yedekleniyor...";
$from = "C:\WebSites\akifsite.com\_Current\*"
$to = "C:\WebSites\akifsite.com\_Old\"+(get-date).ToString('yyyy_MM_dd-hh_mm_ss')+"\"
New-Item -ItemType Directory -Force -Path $to
Copy-Item $from $to -recurse
Write-Host $to " klasorune yedeklendi";
$siteName = "akifsite.com"; #poolState name aynı diye bunu kullanıyorum, farklı olsa poolName eklemek lazım - akif 30.09.2020
$poolState="";
$siteState ="";
$currentRetry = 0;
Write-Host $siteName " durduruluyor...";
do{
$siteState = (Get-WebsiteState $siteName).Value;
$poolState = (Get-WebAppPoolState $siteName).Value
if($siteState -eq "Started"){
STOP-Website $siteName;
}
if($poolState -eq "Started"){
Stop-WebAppPool -Name $siteName;
}
if($siteState -eq "Started" -or $poolState -eq "Started"){
Start-Sleep -s 5;
}
$currentRetry = $currentRetry + 1;
}while ($siteState -eq "Started" -and $currentRetry -le 20)
Write-Host $siteName " Durdu (" $currentRetry "sn)";
Get-ChildItem "C:\WebSites\akifsite.com\_Current" -Exclude api,web.config | Remove-Item -Recurse; #api uygulamsı ve config ayarları olduğu için onları silmiyoruz
Write-Host "Uygulama guncelleniyor...";
$from = "C:\WebSites\akifsite.com\_New\ui\*"
$to = "C:\WebSites\akifsite.com\_Current\"
New-Item -ItemType Directory -Force -Path $to
Copy-Item $from $to -recurse
Write-Host "Uygulama guncellendi";
Write-Host $siteName " calistiriliyor.."
if($siteState -eq "Stopped"){
Start-Website $siteName;
}
if($poolState -eq "Stopped"){
Start-WebAppPool -Name $siteName;
}
Write-Host $siteName " calisiyor"
Write-Host "Bitti"
Read-Host
app.UseEndpoints(endpoints => { endpoints.MapGet("/", async context => { var response = JsonConvert.Seriali...