diff --git a/Execute-MySQLScript.ps1 b/Execute-MySQLScript.ps1 index 408c36e..ce41a7d 100644 --- a/Execute-MySQLScript.ps1 +++ b/Execute-MySQLScript.ps1 @@ -23,9 +23,16 @@ param #Wake the site up, thereby starting MySQL. (MySQLInApp is started as a subprocess by IIS). $ProgressPreference = "SilentlyContinue" -Invoke-WebRequest -URI "https://$ENV:WEBSITE_HOSTNAME" -UseBasicParsing -ErrorAction SilentlyContinue + #Wake the site up, thereby starting MySQL. (MySQLInApp is started as a subprocess by IIS). -&"D:\Program Files (x86)\Git\usr\bin\curl.exe" "https://$ENV:WEBSITE_HOSTNAME" +$curlPath = Invoke-Expression -Command 'cmd /c "where curl"' +$siteUrl = "https://$ENV:WEBSITE_HOSTNAME" +if (-not ([String]::IsNullOrWhiteSpace($curlPath))) { + Invoke-Expression -Command "& $curlPath $siteUrl" -Verbose +} +else { + Write-Debug "curl not in path." +} #Open the MysqlConnection [System.Reflection.Assembly]::LoadWithPartialName("MySql.Data") diff --git a/InitializeDatabase.cmd b/InitializeDatabase.cmd new file mode 100644 index 0000000..8614cb0 --- /dev/null +++ b/InitializeDatabase.cmd @@ -0,0 +1 @@ +powershell -ExecutionPolicy bypass -File d:\home\site\repository\Execute-MySQLScript.ps1 -ScriptPath D:\home\site\wwwroot\schema\ttrss_schema_mysql.sql \ No newline at end of file diff --git a/config.php b/config.php index ec60ab8..0bebbb8 100644 --- a/config.php +++ b/config.php @@ -29,7 +29,7 @@ // *** Basic settings (important!) *** // *********************************** define('_SKIP_SELF_URL_PATH_CHECKS', true); - define('SELF_URL_PATH', $_SERVER["HTTP_HOST"]); + define('SELF_URL_PATH', 'https://' . $_SERVER['HTTP_HOST']); // Full URL of your tt-rss installation. This should be set to the // location of tt-rss directory, e.g. http://example.org/tt-rss/ // You need to set this option correctly otherwise several features diff --git a/deploy.cmd b/deploy.cmd index 2ee567b..618fdd3 100644 --- a/deploy.cmd +++ b/deploy.cmd @@ -10,12 +10,10 @@ REM copy config.php to app copy d:\home\site\repository\config.php d:\home\site\wwwroot REM deploy database -powershell -ExecutionPolicy bypass -File d:\home\site\repository\Execute-MySQLScript.ps1 -ScriptPath D:\home\site\wwwroot\schema\ttrss_schema_mysql.sql +mkdir d:\home\site\deployments\tools\PostDeploymentActions +copy InitializeDatabase.cmd d:\home\site\deployments\tools\PostDeploymentActions REM d:\home\site\wwwroot\app_data\jobs\triggered\updateFeeds -mkdir d:\home\site\wwwroot\app_data -mkdir d:\home\site\wwwroot\app_data\jobs\ -mkdir d:\home\site\wwwroot\app_data\jobs\triggered mkdir d:\home\site\wwwroot\app_data\jobs\triggered\updateFeeds copy d:\home\site\repository\updateFeeds.cmd d:\home\site\wwwroot\app_data\jobs\triggered\updateFeeds\updateFeeds.cmd copy d:\home\site\repository\settings.job d:\home\site\wwwroot\app_data\jobs\triggered\updateFeeds\settings.job