-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathliquibase.flowfile-cd-rollback.yaml
63 lines (53 loc) · 2.12 KB
/
liquibase.flowfile-cd-rollback.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
########## LIQUIBASE FLOWFILE ##########
########## learn more http://docs.liquibase.com/flow ##########
## Run this file by executing "liquibase flow" or "liquibase flow --flow-file=liquibase.flowfile.yaml"
# globalVariables:
# SCHEMA: DEV
# BYPASS_LIQUIBASE_CHECKS: bypass
## Note: Any command which fails in any stage below result in the command stopping, and endStage being run.
## A flow file can have one or more stages, each with multiple "actions",
## or your flow file can have multiple stages with fewer actions in each stage.
stages:
# Drift_Detection:
# actions:
# - type: liquibase
# command: diff
# cmdArgs: { referenceUrl: "offline:postgresql?snapshot=mySnapshot.json", format: json }
# globalArgs: { outputFile: "diff.json", mirror-console-messages-to-log: "true"}
# - type: shell
# command: powershell "./myscript.ps1"
Status Database:
actions:
- type: liquibase
command: status
cmdArgs: {verbose: "true"}
globalArgs: { contexts: "${SCHEMA}", liquibase-schema-name: "${SCHEMA}"}
# Run Quality Checks:
# actions:
# - type: liquibase
# command: checks run
# cmdArgs: {checks-scope: changelog}
# - type: shell
# command: |
# if %BYPASS_LIQUIBASE_CHECKS% == bypass (
# echo BYPASS_LIQUIBASE_CHECKS=true
# liquibase checks run || exit /b 0
# ) else (
# echo BYPASS_LIQUIBASE_CHECKS=false
# liquibase checks run
# timeout 5
# )
DB_Rollback:
actions:
- type: liquibase
command: rollback
cmdArgs: {tag: "${ROLLBACKTAG}"}
globalArgs: { contexts: "${SCHEMA}", liquibase-schema-name: "${SCHEMA}"}
## The endStage ALWAYS RUNS.
## So put actions here which you desire to perform whether previous stages' actions succeed or fail.
## If you do not want any actions to ALWAYS RUN, simply delete the endStage from your flow file.
endStage:
actions:
- type: liquibase
command: history
globalArgs: { contexts: "${SCHEMA}", liquibase-schema-name: "${SCHEMA}"}