Skip to content

Commit b660d41

Browse files
change cookbook to run code analysis 1st
1 parent dce318e commit b660d41

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

Generic-POC-Flyway-Commands/CLI/cookbook.sh

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,44 @@
44
# Each command below can be copied and pasted independently
55
# Update the inline values as needed for your environment
66

7-
# generic deployment
8-
flyway migrate -configFiles="C:\WorkingFolders\FWD\NewWorldDB\flyway.toml,C:\WorkingFolders\FWD\NewWorldDB\flyway.user.toml" -workingDirectory="C:\WorkingFolders\FWD\NewWorldDB" -schemaModelLocation="./schema-model" -schemaModelSchemas= -environment=test
7+
# ================================================================================
8+
9+
# run code analysis only
10+
flyway check -code -environment=test -check.code.failOnError=false
911

1012
# ================================================================================
1113

14+
# generic deployment
15+
flyway migrate -environment=test
16+
17+
1218
# create snapshot after changes
13-
flyway snapshot -environment=test -filename=snapshothistory:current -configFiles="C:\WorkingFolders\FWD\NewWorldDB\flyway.toml,C:\WorkingFolders\FWD\NewWorldDB\flyway.user.toml" -workingDirectory="C:\WorkingFolders\FWD\NewWorldDB" -schemaModelLocation="./schema-model"
19+
flyway snapshot -environment=test -filename=snapshothistory:current
1420

1521
# ================================================================================
1622

1723
# undo back to a specific target number
18-
flyway undo -configFiles="C:\WorkingFolders\FWD\NewWorldDB\flyway.toml,C:\WorkingFolders\FWD\NewWorldDB\flyway.user.toml" -workingDirectory="C:\WorkingFolders\FWD\NewWorldDB" -schemaModelLocation="./schema-model" -schemaModelSchemas= -environment=test -target=043.20250716213211
24+
flyway undo -schemaModelSchemas= -environment=test -target=043.20250716213211
1925

2026
# ================================================================================
2127

2228
# cherryPick forward
23-
flyway migrate -configFiles="C:\WorkingFolders\FWD\NewWorldDB\flyway.toml,C:\WorkingFolders\FWD\NewWorldDB\flyway.user.toml" -workingDirectory="C:\WorkingFolders\FWD\NewWorldDB" -schemaModelLocation="./schema-model" -schemaModelSchemas= -environment=test -cherryPick=045.20251106201536
29+
flyway migrate -schemaModelSchemas= -environment=test -cherryPick=045.20251106201536
2430

2531
# ================================================================================
2632

2733
# drift and code analysis report with snapshots
2834

2935
# run drift and code analysis (TO SEE DRIFT ALTER TARGET DB OUTSIDE OF FLYWAY)
3036
# check can be configured to fail on drift or code analysis triggering
31-
# it's possible to capture changes as well, but it is a duplication of what's stored in schema model and requires an extra database to deploy to in a CI fashion
32-
flyway check -drift -code -dryrun -environment=test -check.code.failOnError=false -check.failOnDrift=false -check.deployedSnapshot=snapshothistory:current -configFiles="C:\WorkingFolders\FWD\NewWorldDB\flyway.toml,C:\WorkingFolders\FWD\NewWorldDB\flyway.user.toml" -workingDirectory="C:\WorkingFolders\FWD\NewWorldDB" -schemaModelLocation="./schema-model"
37+
flyway check -drift -code -dryrun -environment=test -check.code.failOnError=false -check.failOnDrift=false -check.deployedSnapshot=snapshothistory:current
3338

3439
# ================================================================================
3540

3641
# generic deployment
37-
flyway migrate -configFiles="C:\WorkingFolders\FWD\NewWorldDB\flyway.toml,C:\WorkingFolders\FWD\NewWorldDB\flyway.user.toml" -workingDirectory="C:\WorkingFolders\FWD\NewWorldDB" -schemaModelLocation="./schema-model" -schemaModelSchemas= -environment=test
42+
flyway migrate -schemaModelSchemas= -environment=test
3843

3944
# ================================================================================
4045

4146
# create snapshot after changes
42-
flyway snapshot -environment=test -filename=snapshothistory:current -configFiles="C:\WorkingFolders\FWD\NewWorldDB\flyway.toml,C:\WorkingFolders\FWD\NewWorldDB\flyway.user.toml" -workingDirectory="C:\WorkingFolders\FWD\NewWorldDB" -schemaModelLocation="./schema-model"
47+
flyway snapshot -environment=test -filename=snapshothistory:current

Generic-POC-Flyway-Commands/fullFlywayPOCSetupAndRun.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Set parameters
1+
#fullFlywayPOCSetupAndRun.ps1
22
$overWriteProject = $false # Set to true to delete and recreate the project folder. Can be useful when configuring from scratch.
33
$databaseType = "SqlServer" # alt values: SqlServer Oracle PostgreSql MySql
44
# connection string to prodlike database
@@ -20,7 +20,7 @@ $workingDir = "$projectPath\$projectName"
2020
# Set the schemas value
2121
$Schemas = @("") # can be empty for SqlServer
2222

23-
# Initialize variables at script level - these will be provided later do not fill
23+
# DO NOT FILL - Initialize variables at script level - these will be provided later do not fill
2424
$devDatabaseName = ""
2525
$devUrl = ""
2626
$testDatabaseName = ""
@@ -91,7 +91,7 @@ if ($overWriteProject -or -not (Test-Path -Path "$workingDir")) {
9191
Set-Location "$projectPath\$projectName"
9292
}
9393

94-
$pocSetupMessage = "`nYDo you want to set up a full POC environment with dev and test databases?"
94+
$pocSetupMessage = "`nDo you want to set up a full POC environment with dev and test databases?"
9595
if ($backupPath -ne "") {
9696
$pocSetupMessage += " $backupPath WILL BE RESTORED multiple times to provided instance for dev and test databases. (Y/N)?"
9797
} else {

0 commit comments

Comments
 (0)