forked from szandany/Liquibase_Snowflake_Example
-
Notifications
You must be signed in to change notification settings - Fork 1
137 lines (124 loc) · 3.44 KB
/
liquibase_workflow.yml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# This is a basic workflow to help you get started with Actions
name: run_changes
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
workflow_dispatch:
# push:
# branches: [ main ]
# pull_request:
# branches: [ main ]
inputs:
tag:
description: 'Enter tag for rollback'
required: true
env:
LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.LIQUIBASE_PRO_LICENSE_KEY }}
LIQUIBASE_COMMAND_URL: ${{ secrets.LIQUIBASE_COMMAND_URL }}
LIQUIBASE_COMMAND_USERNAME: ${{ secrets.LIQUIBASE_COMMAND_USERNAME }}
LIQUIBASE_COMMAND_PASSWORD: ${{ secrets.LIQUIBASE_COMMAND_PASSWORD }}
LIQUIBASE_COMMAND_CHANGELOG_FILE: ${{ secrets.LIQUIBASE_COMMAND_CHANGELOG_FILE }}
LIQUIBASE_COMMAND_TAG: ${{ github.event.inputs.tag }}
LIQUIBASE_LOG_FORMAT: "JSON"
LIQUIBASE_LOG_LEVEL: "INFO"
jobs:
Build_Job:
runs-on: ubuntu-latest
environment:
name: DEV
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.LB_GH_TOKEN }}
- name: Running Flow
uses: docker://liquibase/liquibase
with:
args: --log-file=runlog_DEV.json flow --flow-file=liquibase.flowfile.yaml
env:
LB_ENVIRONMENT: DEV
###
### Gather logs
###
- name: Gather logs
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: logs
path: |
**/*DEV.json
**/*DEV.html
- name: Checkin snapshot
run: |
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "New Snapshots"
git push
Test_Job:
needs: Build_Job
runs-on: ubuntu-latest
environment:
name: TEST
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.LB_GH_TOKEN }}
- name: Running Flow
uses: docker://liquibase/liquibase
with:
args: --log-file=runlog_TEST.json flow --flow-file=liquibase.flowfile.yaml
env:
LB_ENVIRONMENT: TEST
###
### Gather logs
###
- name: Gather logs
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: logs
path: |
**/*TEST.json
**/*TEST.html
- name: Checkin snapshot
run: |
git pull
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "New Snapshots $LB_ENVIRONMENT"
git push
Deploy_Prod_Job:
needs: Test_Job
runs-on: ubuntu-latest
environment:
name: PROD
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.LB_GH_TOKEN }}
- name: Running Flow
uses: docker://liquibase/liquibase
with:
args: --log-file=runlog_PROD.json flow --flow-file=liquibase.flowfileprod.yaml
env:
LB_ENVIRONMENT: PROD
###
### Gather logs
###
- name: Gather logs
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: logs
path: |
**/*PROD.json
**/*PROD.html
- name: Checkin snapshot
run: |
git pull
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "New Snapshots"
git push