Skip to content

Commit

Permalink
seeding db for testing purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
jiri-malec committed Nov 18, 2024
1 parent c83d6e0 commit 2348785
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,13 @@ jobs:
-U ${{ env.DATABASE_USER }} `
-P ${{ env.DATABASE_PASSWORD }} `
-Q "UPDATE CMS_SettingsKey SET KeyValue='${{ env.XPERIENCE_BY_KENTICO_LICENSE }}' WHERE KeyName='CMSLicenseKey'"
- name: Seed DB with data for testing purposes
run: |
cd scripts
./Seed-Database.ps1
cd ..
- name: Reset DB consistency for last applied hotfix
run: |
dotnet build `
Expand Down
33 changes: 33 additions & 0 deletions scripts/Seed-Database.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<#
.Synopsis
Toggle CMSEnableCI Key valu in DB with flag.
#>

Import-Module (Resolve-Path Settings) `
-Function `
Get-AppSettings `
-Force

Import-Module (Resolve-Path Utilities) `
-Function `
Invoke-ExpressionWithException, `
Invoke-SqlQuery, `
Get-ConnectionString, `
Write-Status `
-Force

$appSettings = Get-AppSettings
$connection = Get-ConnectionString $appSettings

$command = "Invoke-SqlQuery " + `
"-connectionString ""$connection"" " + `
"-query ""INSERT INTO KenticoZapier_ZapierTrigger
VALUES
('e569a1c7', 'BizForm.DancingGoatContactUs', 'Form', 'Create', 'https://hooks.zapier.com/hooks/standard/18364481/7669f3b896c3454da513d8f361464208/');
"" "

Invoke-ExpressionWithException $command

Write-Host "`n"
Write-Status "Database seeded"
Write-Host "`n"

0 comments on commit 2348785

Please sign in to comment.