Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #33 from gopisaba/feature/databaseChangelogTable
Browse files Browse the repository at this point in the history
feat: optional database changelog and lock table parameters
  • Loading branch information
mcred authored Jun 17, 2022
2 parents 048e41c + c1efceb commit 93a18ea
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 2 deletions.
35 changes: 33 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ The `operation` input expects one of the following:
- status
- history
- diff
- validate
- 'checks run' (note that the `checks run` command must be wrapped with quotes in your `build.yml` because the command has a space in it)

### Optional Inputs
Expand All @@ -61,7 +62,7 @@ The `operation` input expects one of the following:

It is recommended that `proLicenseKey` and `hubApiKey` are not stored in plaintext, but rather using a [GitHub secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets):

```
```yaml
proLicenseKey: ${{ secrets.PRO_LICENSE_KEY }}
```

Expand All @@ -75,13 +76,17 @@ The following operations have the subsequent required inputs:
- classpath
- changeLogFile
- count
- databaseChangeLogTableName (optional)
- databaseChangeLogLockTableName (optional)

#### tag

- username
- password
- url
- tag
- databaseChangeLogTableName (optional)
- databaseChangeLogLockTableName (optional)

#### updateToTag

Expand All @@ -91,6 +96,8 @@ The following operations have the subsequent required inputs:
- classpath
- changeLogFile
- tag
- databaseChangeLogTableName (optional)
- databaseChangeLogLockTableName (optional)

#### rollback

Expand All @@ -100,6 +107,8 @@ The following operations have the subsequent required inputs:
- classpath
- changeLogFile
- tag
- databaseChangeLogTableName (optional)
- databaseChangeLogLockTableName (optional)

#### rollbackCount

Expand All @@ -109,6 +118,8 @@ The following operations have the subsequent required inputs:
- classpath
- changeLogFile
- count
- databaseChangeLogTableName (optional)
- databaseChangeLogLockTableName (optional)

#### rollbackToDate

Expand All @@ -118,13 +129,17 @@ The following operations have the subsequent required inputs:
- classpath
- changeLogFile
- date
- databaseChangeLogTableName (optional)
- databaseChangeLogLockTableName (optional)

#### updateSQL

- username
- password
- url
- changeLogFile
- databaseChangeLogTableName (optional)
- databaseChangeLogLockTableName (optional)

#### futureRollbackSQL

Expand All @@ -133,6 +148,8 @@ The following operations have the subsequent required inputs:
- url
- classpath
- changeLogFile
- databaseChangeLogTableName (optional)
- databaseChangeLogLockTableName (optional)

#### status

Expand All @@ -141,13 +158,24 @@ The following operations have the subsequent required inputs:
- url
- classpath
- changeLogFile
- databaseChangeLogTableName (optional)
- databaseChangeLogLockTableName (optional)

#### diff

- username
- password
- url
- referenceUrl
- databaseChangeLogTableName (optional)
- databaseChangeLogLockTableName (optional)

#### validate

- username
- password
- url
- changeLogFile

#### checks run

Expand All @@ -166,9 +194,11 @@ guidelines for [contributing](https://www.liquibase.org/community/index.html)!
#### Developer instructions

We've found that the easiest way to test changes to this GitHub action is to:

- fork this repo to your personal account
- create a sample `build.yml` to trigger the action, noting that the `uses` line specifies the relative path, which will run the action as specified in your fork (rather than the action that is published by Liquibase)
```

```yaml
name: Build and Test
on: [push, pull_request]
Expand All @@ -186,4 +216,5 @@ We've found that the easiest way to test changes to this GitHub action is to:
checksSettingsFile: 'liquibasech.conf'
proLicenseKey: ${{ secrets.PRO_LICENSE_KEY }}
```

- make changes as desired and observe the execution in GitHub
8 changes: 8 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ inputs:
hubApiKey: # string
description: 'Liquibase Hub API key for operations'
required: false
databaseChangeLogTableName: # string
description: 'Specifies the Liquibase changelog table'
required: false
databaseChangeLogLockTableName: # string
description: 'Specifies the Liquibase changelog lock table'
required: false
runs:
using: 'docker'
image: 'Dockerfile'
Expand All @@ -58,6 +64,8 @@ runs:
- ${{ inputs.checksSettingsFile }}
- ${{ inputs.proLicenseKey }}
- ${{ inputs.hubApiKey }}
- ${{ inputs.databaseChangeLogTableName }}
- ${{ inputs.databaseChangeLogLockTableName }}
branding:
icon: database
color: red
26 changes: 26 additions & 0 deletions entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ REFERENCEURL=${10}
CHECKSSETTINGSFILE=${11}
PROLICENSEKEY=${12}
HUBAPIKEY=${13}
DATABASECHANGELOGTABLENAME=${14}
DATABASECHANGELOGLOCKTABLENAME=${15}

PARAMS=()
VALUES=()
Expand Down Expand Up @@ -67,6 +69,8 @@ function validate_operation() {
check_required_param update classpath $CLASSPATH
check_required_param update changeLogFile $CHANGELOGFILE
check_required_param update url $URL
check_optional_param update databaseChangeLogTableName $DATABASECHANGELOGTABLENAME
check_optional_param update databaseChangeLogLockTableName $DATABASECHANGELOGLOCKTABLENAME
;;

updateCount)
Expand All @@ -76,13 +80,17 @@ function validate_operation() {
check_required_param updateCount changeLogFile $CHANGELOGFILE
check_required_param updateCount url $URL
check_required_param updateCount count $COUNT true
check_optional_param updateCount databaseChangeLogTableName $DATABASECHANGELOGTABLENAME
check_optional_param updateCount databaseChangeLogLockTableName $DATABASECHANGELOGLOCKTABLENAME
;;

tag)
check_required_param tag username $USERNAME
check_required_param tag password $PASSWORD
check_required_param tag url $URL
check_required_param tag tag $TAG true
check_optional_param tag databaseChangeLogTableName $DATABASECHANGELOGTABLENAME
check_optional_param tag databaseChangeLogLockTableName $DATABASECHANGELOGLOCKTABLENAME
;;

updateToTag)
Expand All @@ -92,6 +100,8 @@ function validate_operation() {
check_required_param updateToTag changeLogFile $CHANGELOGFILE
check_required_param updateToTag url $URL
check_required_param updateToTag tag $TAG true
check_optional_param updateToTag databaseChangeLogTableName $DATABASECHANGELOGTABLENAME
check_optional_param updateToTag databaseChangeLogLockTableName $DATABASECHANGELOGLOCKTABLENAME
;;

rollback)
Expand All @@ -101,6 +111,8 @@ function validate_operation() {
check_required_param rollback changeLogFile $CHANGELOGFILE
check_required_param rollback url $URL
check_required_param rollback tag $TAG true
check_optional_param rollback databaseChangeLogTableName $DATABASECHANGELOGTABLENAME
check_optional_param rollback databaseChangeLogLockTableName $DATABASECHANGELOGLOCKTABLENAME
;;

rollbackCount)
Expand All @@ -110,6 +122,8 @@ function validate_operation() {
check_required_param rollbackCount changeLogFile $CHANGELOGFILE
check_required_param rollbackCount url $URL
check_required_param rollbackCount count $COUNT true
check_optional_param rollbackCount databaseChangeLogTableName $DATABASECHANGELOGTABLENAME
check_optional_param rollbackCount databaseChangeLogLockTableName $DATABASECHANGELOGLOCKTABLENAME
;;

rollbackToDate)
Expand All @@ -119,6 +133,8 @@ function validate_operation() {
check_required_param rollbackToDate changeLogFile $CHANGELOGFILE
check_required_param rollbackToDate url $URL
check_required_param rollbackToDate date $DATE true
check_optional_param rollbackToDate databaseChangeLogTableName $DATABASECHANGELOGTABLENAME
check_optional_param rollbackToDate databaseChangeLogLockTableName $DATABASECHANGELOGLOCKTABLENAME
;;

updateSQL)
Expand All @@ -127,6 +143,8 @@ function validate_operation() {
check_required_param updateSQL classpath $CLASSPATH
check_required_param updateSQL changeLogFile $CHANGELOGFILE
check_required_param updateSQL url $URL
check_optional_param updateSQL databaseChangeLogTableName $DATABASECHANGELOGTABLENAME
check_optional_param updateSQL databaseChangeLogLockTableName $DATABASECHANGELOGLOCKTABLENAME
;;

futureRollbackSQL)
Expand All @@ -135,6 +153,8 @@ function validate_operation() {
check_required_param futureRollbackSQL classpath $CLASSPATH
check_required_param futureRollbackSQL changeLogFile $CHANGELOGFILE
check_required_param futureRollbackSQL url $URL true
check_optional_param futureRollbackSQL databaseChangeLogTableName $DATABASECHANGELOGTABLENAME
check_optional_param futureRollbackSQL databaseChangeLogLockTableName $DATABASECHANGELOGLOCKTABLENAME
;;

status)
Expand All @@ -143,19 +163,25 @@ function validate_operation() {
check_required_param status classpath $CLASSPATH
check_required_param status changeLogFile $CHANGELOGFILE
check_required_param status url $URL
check_optional_param status databaseChangeLogTableName $DATABASECHANGELOGTABLENAME
check_optional_param status databaseChangeLogLockTableName $DATABASECHANGELOGLOCKTABLENAME
;;

history)
check_required_param history username $USERNAME
check_required_param history password $PASSWORD
check_required_param history url $URL
check_optional_param history databaseChangeLogTableName $DATABASECHANGELOGTABLENAME
check_optional_param history databaseChangeLogLockTableName $DATABASECHANGELOGLOCKTABLENAME
;;

diff)
check_required_param diff username $USERNAME
check_required_param diff password $PASSWORD
check_required_param diff url $URL
check_required_param diff referenceUrl $REFERENCEURL true
check_optional_param diff databaseChangeLogTableName $DATABASECHANGELOGTABLENAME
check_optional_param diff databaseChangeLogLockTableName $DATABASECHANGELOGLOCKTABLENAME
;;

validate)
Expand Down

0 comments on commit 93a18ea

Please sign in to comment.