Skip to content

rollback_changes_targeted #32

rollback_changes_targeted

rollback_changes_targeted #32

# This is a basic workflow to help you get started with Actions
name: rollback_changes_targeted
# 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:
author:
description: 'Author'
required: true
default: 'liquibase-docs'
id:
description: 'ID'
required: true
default: 'createView-example2'
path:
description: 'Path'
required: true
default: 'Changelogs/changelog.sql'
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_REPORTS_ENABLED: "TRUE"
LIQUIBASE_LOG_LEVEL: "INFO"
jobs:
Build_Job:
runs-on: ubuntu-latest
environment:
name: DEV
steps:
- uses: actions/checkout@v4
- name: Rolling back DEV
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@v4
- name: Rolling back TEST
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 TEST
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: rollback1-reports-TEST
path: |
**/Rollback*.html
Deploy_Prod_Job:
needs: Test_Job
runs-on: ubuntu-latest
environment:
name: PROD
steps:
- uses: actions/checkout@v4
- name: Rolling back PROD
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