Liquibase Hub Properties
Liquibase Hub has a list of properties to be set so that your local Liquibase activity is reported to a specific Liquibase Hub Project.
Required properties
Specifying the Liquibase Hub API Keys is the required property to connect to Liquibase Hub along with a registered changelog file.
There are three ways to specify your API Key:
- Including
liquibase.hub.ApiKey
value in theliquibase.properties
file:
liquibase.hub.ApiKey: <addYourHubApiKeyHere>
An example of the liquibase.properties
file with the Liquibase Hub API Key
# liquibase.properties
changeLogFile: ../path/to/file/dbchangelog.xml
driver: oracle.jdbc.OracleDriver
url: jdbc:oracle:thing:@192.168.0.22:1521/orcl
username: PRO
password: password
referenceDriver: oracle.jdbc.oracleDriver
referenceurl: jdbc:oracle:thin:@192.168.0.22:1521/orcl
referencePassword: password
liquibaseProLicenseKey: <addYourProLicenseKeyHere>
classpath: ../path/to/file/ojdbc6-11.2.0.3.0.jar
# Add Your First Liquibase Hub API Key
liquibase.hub.ApiKey: <addYourHubApiKeyHere>
- Passing
liquibaseHubApiKey
on the command line:
--liquibaseHubApiKey=addYourHubApiKeyHere
An example of the Liquibase Hub API Key running on the command line
java -jar liquibase.jar \
--driver=oracle.jdbc.Oracleoriver \
--classpath=../path/to/file/ojdbc6-11.2.0.3.0.jar \
--changeLogFile=com/example/db.changelog.xml \
--url="jdbc:oracle:thing:@192.168.0.22:1521/orcl" \
--username=scott \
--password=tiger \
--liquibaseProLicenseKey=<addYourProLicenseKeyHere>\
--liquibaseHubApiKey=<addYourHubApiKeyHere>\
update
- Specifying API key in your JAVA_OPTS as
-Dliquibase.hub.apiKey
. For example, to set JAVA_OPTS on Windows, Linux, or MacOS, runSET JAVA_OPTS=”-Dliquibase.hub.apikey=<myapikey>”
.
Note: You can also manually set JAVA_OPTS as an environment variable in your system.
Optional properties
The Liquibase Hub URL, which is https://hub.liquibase.com, is specified by default when you sign up for an account and connect to Liquibase Hub with the API Key.
There are two ways to change the location property, select one of the following two options:
- Include
liquibase.hub.url
value in theliquibase.properties
file:
liquibase.hub.url:https://hub.liquibase.com
- Specify URL in your JAVA_OPTS as
-DliquibaseHubUrl
. To set JAVA_OPTS on Windows, Linux, or MacOS, runSET JAVA_OPTS="-DLiquibaseHubUrl=https://hub.liquibase.com"
.
Note: You can also manually set JAVA_OPTS as an environment variable in your system.
Another optional property is liquibase.hub.mode
, which represents the level of data you want to send to Liquibase Hub. The default value is: all
.
liquibase.hub.mode:[all=default|meta|off]
Liquibase Hub mode | Definition |
---|---|
|
Sends all data, including the changeset body, generated SQL, and logs (the default value) |
|
Does not send the changeset body, generated SQL, or operation-event and change-event logs |
|
Does not send any data to Liquibase Hub |
To specify the level of data, select one of the following options:
- Include
liquibase.hub.mode
value in theliquibase.properties
file:
liquibase.hub.mode:meta
- Specify the Liquibase Hub mode in your JAVA_OPTS as
-DLiquibaseHubMode
. To set JAVA_OPTS on Windows, Linux, or MacOS, runSET JAVA_OPTS="-DLiquibaseHubMode=[all|meta|off]"
.
Note: You can also manually set JAVA_OPTS as an environment variable in your system.
Additionally, you can have different Liquibase Hub mode settings for different connections.
For example, if sensitive DML updates are only made to the PROD connection and not to lower-level connections, you can have PROD in the meta
mode and all lower connections in the all
mode.
You can specify the liquibase.hub.mode
in your liquibase.properties
file, as a system property with -DliquibaseHubMode
, as an environment variable LIQUIBASE_HUB_MODE
, or store it in a liquibase.prod.properties
file.
If you specify the Liquibase Hub mode only in one place, Liquibase will use it as the default. If you have the Liquibase Hub mode specified in multiple places, Liquibase will use the following order of precedence to determine which value to use:
- The
liquibase.prod.properties
file - The
liquibase.properties
file - The
LIQUIBASE_HUB_MODE
environment variable, which overrides all of the preceding places
If you have policies and compliance requirements that prohibit sensitive information (PII or HIPAA) from leaving the controlled domain, use liquibase.hub.mode=meta
. The meta
mode is recommended if your scripts contain data that is regulated by government compliance standards, such as HIPAA, PCI, and others.