Skip to content

Commit

Permalink
Merge pull request #2 from molivasdat/lbjenn-patch-1
Browse files Browse the repository at this point in the history
Lbjenn patch 1
  • Loading branch information
molivasdat authored Aug 12, 2024
2 parents 1d50b92 + 4dfaa5c commit 896ed3f
Show file tree
Hide file tree
Showing 24 changed files with 59,263 additions and 1,733 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lb_rollback_onedb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
name: ${{ github.event.inputs.db }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ secrets.LB_GH_TOKEN }}

Expand All @@ -55,5 +55,5 @@ jobs:
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Restore snapshotfile"
git commit -m "Restore snapshotfile for ${{ github.event.inputs.db }}"
git push
53 changes: 46 additions & 7 deletions .github/workflows/liquibase_rollback_targeted_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ env:
LIQUIBASE_COMMAND_USERNAME: ${{ secrets.LIQUIBASE_COMMAND_USERNAME }}
LIQUIBASE_COMMAND_PASSWORD: ${{ secrets.LIQUIBASE_COMMAND_PASSWORD }}
LIQUIBASE_COMMAND_CHANGELOG_FILE: ${{ secrets.LIQUIBASE_COMMAND_CHANGELOG_FILE }}
LIQUIBASE_REPORTS_ENABLED: "TRUE"
LIQUIBASE_LOG_LEVEL: "INFO"


jobs:
Expand All @@ -40,26 +42,51 @@ jobs:
name: DEV

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Rolling back DEV
uses: docker://liquibase/liquibase
uses: docker://liquibase/liquibase:4.28.0
with:
args: rollbackOneChangeset --changeset-author=${{ github.event.inputs.author }} --changeset-id=${{ github.event.inputs.id }} --changeset-path=${{ github.event.inputs.path }} --force

###
### Gather logs
###
- name: Gather reports DEV
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: rollback1-reports-DEV
path: |
**/Rollback*.html
Test_Job:
needs: Build_Job
runs-on: ubuntu-latest
environment:
name: TEST

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Rolling back TEST
uses: docker://liquibase/liquibase
uses: docker://liquibase/liquibase:4.28.0
with:
args: rollbackOneChangeset --changeset-author=${{ github.event.inputs.author }} --changeset-id=${{ github.event.inputs.id }} --changeset-path=${{ github.event.inputs.path }} --force
args: rollbackOneChangeset --changeset-author=${{ github.event.inputs.author }} --changeset-id=${{ github.event.inputs.id }} --changeset-path=${{ github.event.inputs.path }} --force

###
### Gather logs
###
- name: Gather reports TEST
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: rollback1-reports-TEST
path: |
**/Rollback*.html


Deploy_Prod_Job:
needs: Test_Job
Expand All @@ -68,9 +95,21 @@ jobs:
name: PROD

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Rolling back PROD
uses: docker://liquibase/liquibase
uses: docker://liquibase/liquibase:4.28.0
with:
args: rollbackOneChangeset --changeset-author=${{ github.event.inputs.author }} --changeset-id=${{ github.event.inputs.id }} --changeset-path=${{ github.event.inputs.path }} --force

###
### Gather logs
###
- name: Gather reports PROD
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: rollback1-reports-PROD
path: |
**/Rollback*.html
6 changes: 3 additions & 3 deletions .github/workflows/liquibase_rollback_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
name: DEV

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Rolling back DEV changes
uses: docker://liquibase/liquibase
Expand All @@ -50,7 +50,7 @@ jobs:
name: TEST

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Rolling back TEST changes
uses: docker://liquibase/liquibase
Expand All @@ -69,7 +69,7 @@ jobs:
name: PROD

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Rolling back PROD changes
uses: docker://liquibase/liquibase
Expand Down
31 changes: 16 additions & 15 deletions .github/workflows/liquibase_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ env:
LIQUIBASE_COMMAND_TAG: ${{ github.event.inputs.tag }}
LIQUIBASE_LOG_FORMAT: "JSON"
LIQUIBASE_LOG_LEVEL: "INFO"
FORCE_JAVASCRIPT_ACTIONS_TO_NODE20: "TRUE"

jobs:

Expand All @@ -33,11 +34,11 @@ jobs:
name: DEV

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ secrets.LB_GH_TOKEN }}
- name: Running Flow
uses: docker://liquibase/liquibase
uses: docker://liquibase/liquibase:4.28.0
with:
args: --log-file=runlog_DEV.json flow --flow-file=liquibase.flowfile.yaml
env:
Expand All @@ -47,9 +48,9 @@ jobs:
###
- name: Gather logs
if: success() || failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: logs
name: logs-DEV
path: |
**/*DEV.json
**/*DEV.html
Expand All @@ -58,7 +59,7 @@ jobs:
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "New Snapshots"
git commit -m "DEV Deploy Reports and Logs"
git push

Expand All @@ -69,11 +70,11 @@ jobs:
name: TEST

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ secrets.LB_GH_TOKEN }}
- name: Running Flow
uses: docker://liquibase/liquibase
uses: docker://liquibase/liquibase:4.28.0
with:
args: --log-file=runlog_TEST.json flow --flow-file=liquibase.flowfile.yaml
env:
Expand All @@ -83,9 +84,9 @@ jobs:
###
- name: Gather logs
if: success() || failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: logs
name: logs-TEST
path: |
**/*TEST.json
**/*TEST.html
Expand All @@ -95,7 +96,7 @@ jobs:
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "New Snapshots $LB_ENVIRONMENT"
git commit -m "$LB_ENVIRONMENT Deploy Reports and Logs"
git push
Deploy_Prod_Job:
Expand All @@ -105,11 +106,11 @@ jobs:
name: PROD

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ secrets.LB_GH_TOKEN }}
- name: Running Flow
uses: docker://liquibase/liquibase
uses: docker://liquibase/liquibase:4.28.0
with:
args: --log-file=runlog_PROD.json flow --flow-file=liquibase.flowfileprod.yaml
env:
Expand All @@ -119,9 +120,9 @@ jobs:
###
- name: Gather logs
if: success() || failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: logs
name: logs-PROD
path: |
**/*PROD.json
**/*PROD.html
Expand All @@ -131,7 +132,7 @@ jobs:
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "New Snapshots"
git commit -m "$LB_ENVIRONMENT Deploy Reports and Logs"
git push
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
driftdetection.txt
liquibase.properties
Snapshots/
Snapshots/
logs/
*.html
2 changes: 1 addition & 1 deletion Changelogs/changelog.sql
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ BEGIN
RETURN number_2;
END IF;
END;
--rollback DROP PROCEDURE return_greater(INTEGER, INTEGER)
--rollback DROP PROCEDURE return_greater(INTEGER, INTEGER)
10 changes: 5 additions & 5 deletions Diff_DEV.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"diff": {
"diffFormat": 1,
"created": "Thu Feb 22 20:19:49 UTC 2024",
"created": "Thu Aug 01 19:28:56 UTC 2024",
"databases": {
"reference": {
"majorVersion": "7",
"minorVersion": "31",
"majorVersion": "8",
"minorVersion": "28",
"name": "Offline snowflake",
"url": "offline:snowflake?snapshot=Snapshot_DEV.json"
},
"target": {
"majorVersion": "7",
"minorVersion": "31",
"majorVersion": "8",
"minorVersion": "28",
"name": "Snowflake",
"url": "jdbc:snowflake://ba89345.us-east-2.aws.snowflakecomputing.com:443/"
}
Expand Down
Loading

0 comments on commit 896ed3f

Please sign in to comment.