forked from szandany/Liquibase_Snowflake_Example
-
Notifications
You must be signed in to change notification settings - Fork 1
/
liquibase.flowfileprod.yaml
58 lines (55 loc) · 1.72 KB
/
liquibase.flowfileprod.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
########## LIQUIBASE FLOWFILE ##########
########## learn more http://docs.liquibase.com/flow ##########
globalVariables:
### Files
### Use absolute paths when using Liquibase's Docker container
###
BASE_DIR: "./"
DIFF_FILE: "${BASE_DIR}/Diff_${LB_ENVIRONMENT}.json"
SNAPSHOT_FILE: "Snapshot_${LB_ENVIRONMENT}.json"
stages:
## The first stage of actions
Default:
actions:
#
# Quality Checks for changelog
#
- type: liquibase
command: checks run
cmdArgs: {checks-scope: changelog, reports-enabled: true, report-name: "checks-report-${LB_ENVIRONMENT}.html" }
#
# Run diff
# Update database type in cmdArgs (e.g., oracle, mssql, etc.)
#
- type: liquibase
command: diff
globalArgs: { outputfile: "${DIFF_FILE}" }
cmdArgs: { referenceURL: "offline:snowflake?snapshot=${SNAPSHOT_FILE}", format: json, reports-enabled: true, report-name: "drift-report-${LB_ENVIRONMENT}.html" }
#
# Review pending changes
#
- type: liquibase
command: updateSQL
#
# Tag the database
#
- type: liquibase
command: tag
#
# Update the database
#
- type: liquibase
command: update
cmdArgs: { reports-enabled: true, report-name: "update-report-${LB_ENVIRONMENT}.html" }
#
# Create updated snapshot
#
- type: liquibase
command: snapshot
globalArgs: { outputfile: "${BASE_DIR}/${SNAPSHOT_FILE}" }
cmdArgs: { snapshotFormat: "json" }
## do these actions after all flow commands, regardless of whether the above commands were successful
endStage:
actions:
- type: liquibase
command: history