Skip to content

Commit

Permalink
postDeploy
Browse files Browse the repository at this point in the history
  • Loading branch information
botmtl committed Sep 3, 2017
1 parent 58c00dd commit 9b256f1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
11 changes: 9 additions & 2 deletions Execute-MySQLScript.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions InitializeDatabase.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
powershell -ExecutionPolicy bypass -File d:\home\site\repository\Execute-MySQLScript.ps1 -ScriptPath D:\home\site\wwwroot\schema\ttrss_schema_mysql.sql
2 changes: 1 addition & 1 deletion config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions deploy.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9b256f1

Please sign in to comment.