You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/FlywayMigrationPlugin.groovy
+13-4Lines changed: 13 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -20,9 +20,6 @@ class FlywayMigrationPlugin implements TerraformEnvironmentStagePlugin, Resettab
20
20
withEnv(environmentVariables) {
21
21
def command =newFlywayCommand('info')
22
22
sh buildFlywayCommand(command)
23
-
if (confirmBeforeApply && hasPendingMigration(delegate)) {
24
-
confirmMigration(delegate)
25
-
}
26
23
}
27
24
}
28
25
}
@@ -42,7 +39,15 @@ class FlywayMigrationPlugin implements TerraformEnvironmentStagePlugin, Resettab
42
39
43
40
publicvoidconfirmMigration(workflowScript) {
44
41
def closure = {
45
-
sh "echo Pending migration detected, prompt again"
42
+
def userInput
43
+
try {
44
+
timeout(time: 1, unit: 'MINUTES') {
45
+
userInput = input("There is a pending migration that will be applied immediately if you continue. Please review the flyway info output. Are you sure you want to continue?")
46
+
sh "echo userInput was: ${userInput}"
47
+
}
48
+
} catch (ex) {
49
+
throw ex
50
+
}
46
51
}
47
52
48
53
closure.delegate = workflowScript
@@ -51,6 +56,10 @@ class FlywayMigrationPlugin implements TerraformEnvironmentStagePlugin, Resettab
51
56
52
57
publicClosureflywayMigrateClosure() {
53
58
return { innerClosure->
59
+
if (confirmBeforeApply && hasPendingMigration(delegate)) {
0 commit comments