Skip to content

Commit

Permalink
Fix publish errors
Browse files Browse the repository at this point in the history
  • Loading branch information
martinkyjac committed Oct 21, 2024
1 parent bda773b commit 81ef6fa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: 1
PROJECT_NAME: DancingGoat
DB_NAME: XByK_DancingGoat_Shopify_UAT
ASPNETCORE_URLS: https://localhost:14065
STATUS_CHECK_URL: https://localhost:14065/status

Expand Down Expand Up @@ -90,27 +91,27 @@ jobs:
-d master `
-U "sa" `
-P "Pass@12345" `
-Q "RESTORE DATABASE [XByK_DancingGoat_Shopify_UAT] FROM DISK='/var/opt/mssql/backup/${{ env.DATABASE_BACKUP_FILENAME }}' WITH MOVE 'XByK_DancingGoat_Shopify' TO '/var/opt/mssql/data/XByK_DancingGoat_Shopify_UAT.mdf', MOVE 'XByK_DancingGoat_Shopify_log' TO '/var/opt/mssql/data/XByK_DancingGoat_Shopify_UAT_log.ldf'"
-Q "RESTORE DATABASE [${{env.DB_NAME}}] FROM DISK='/var/opt/mssql/backup/${{ env.DATABASE_BACKUP_FILENAME }}' WITH MOVE 'XByK_DancingGoat_Shopify' TO '/var/opt/mssql/data/${{env.DB_NAME}}.mdf', MOVE 'XByK_DancingGoat_Shopify_log' TO '/var/opt/mssql/data/${{env.DB_NAME}}_log.ldf'"
sqlcmd `
-S localhost `
-d master `
-U "sa" `
-P "Pass@12345" `
-Q "SELECT KeyValue FROM XByK_DancingGoat_Shopify_UAT.dbo.CMS_SettingsKey WHERE KeyName = 'CMSDBVersion'"
-Q "SELECT KeyValue FROM ${{env.DB_NAME}}.dbo.CMS_SettingsKey WHERE KeyName = 'CMSDBVersion'"
sqlcmd `
-S localhost `
-d master `
-U "sa" `
-P "Pass@12345" `
-Q "SELECT TOP 1 EventTime, EventDescription FROM XByK_DancingGoat_Shopify_UAT.dbo.CMS_EventLog ORDER BY EventTime DESC"
-Q "SELECT TOP 1 EventTime, EventDescription FROM ${{env.DB_NAME}}.dbo.CMS_EventLog ORDER BY EventTime DESC"
if: endsWith(env.DATABASE_BACKUP_FILENAME, '.bak')

- name: Restore Database .bacpac
run: |
sqlpackage `
/a:Import `
/tsn:localhost `
/tdn:XByK_DancingGoat_Shopify_UAT `
/tdn:${{env.DB_NAME}} `
/tu:sa `
/tp:Pass@12345 `
/sf:"./database/${{ env.DATABASE_BACKUP_FILENAME }}" `
Expand Down
3 changes: 3 additions & 0 deletions examples/DancingGoat-Shopify/DancingGoat.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
<PropertyGroup Condition="'$(SeparatedAdmin)' == 'true'">
<DefineConstants>$(DefineConstants);SEPARATED_ADMIN</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="kentico.xperience.admin" Condition="'$(SeparatedAdmin)' == 'false'" />
<PackageReference Include="kentico.xperience.azurestorage" />
Expand Down
5 changes: 3 additions & 2 deletions scripts/Restore-CI.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ $projectPath = Get-WebProjectPath
$repositoryPath = Join-Path $projectPath "App_Data/CIRepository"
$launchProfile = $Env:ASPNETCORE_ENVIRONMENT -eq "CI" ? "EcommerceShopify.WebCI" : "DancingGoat"
$configuration = $Env:ASPNETCORE_ENVIRONMENT -eq "CI" ? "Release" : "Debug"
$dbName = $Env:DB_NAME

$turnOffCI = "sqlcmd " + `
"-S localhost " + `
"-d master " + `
"-d $dbName " + `
"-U `"sa`" " + `
"-P `"Pass@12345`" " + `
"-Q `"UPDATE XByK_DancingGoat_Shopify_UAT.dbo.CMS_SettingsKey SET KeyValue = N'False' WHERE KeyName = N'CMSEnableCI'`""
"-Q `"UPDATE CMS_SettingsKey SET KeyValue = N'False' WHERE KeyName = N'CMSEnableCI'`""

$updateCommand = "dotnet run " + `
"--launch-profile $launchProfile " + `
Expand Down

0 comments on commit 81ef6fa

Please sign in to comment.