Datical DB includes a forceSync
command that can be executed from the CLI and GUI. The forceSync
command refreshes the DMC DB with the version of the changelog that is available on the client from which the command is executed.
You can use the forceSync
command to force the resynchronization to DMC DB using the files that are currently active in the workspace. The command will help to resynchronize the changelog with the DMC backend and to correct the status of issues that may arise when an old or non-standard version of the changelog has been used to determine the status.
Using forceSync in your CLI
Before running the forceSync
command in the CLI, perform the following:
Create a new project or use the existing project with the dbDef and dmcDbDef connected. See dbDef, dmcDbDef, and Force Sync.
Enable runtime credentials.
Set environment variables for
dbDef
anddmcDbDef
. Supported variables are:
DMC environment variables
DDB_DMCDB_USER DDB_DMCDB_PASS DDB_AUDIT_USER DDB_AUDIT_PASS
DBDEF environment variables
DDB_USER_<dbDefNameHere> DDB_PASS_<dbDefNameHere> For example: DB_USER_REF1 DB_PASS_REF1 DB_USER_DEV DB_PASS_DEV DB_USER_QA DB_PASS_QA DB_USER_PROD DB_PASS_PROD
Since your project should be registered with DMC, refer to Register your Project with DMC for more information.
2. To run the forceSync
command, open your CLI and enter the following:
hammer forceSync
Using Force Sync in your GUI
To use the Force Sync capability in the Datical DB GUI, perform the following:
Ensure you have the
dbDef
anddmcDbDef
connected to your project. See dbDef, dmcDbDef, and Force Sync.Set environment variables for
dbDef
anddmcDbDef
. Supported variables are:
DMC environment variables
DDB_DMCDB_USER DDB_DMCDB_PASS DDB_AUDIT_USER DDB_AUDIT_PASS
DBDEF environment variables
DDB_USER_<dbDefNameHere> DDB_PASS_<dbDefNameHere> For example: DB_USER_REF1 DB_PASS_REF1 DB_USER_DEV DB_PASS_DEV DB_USER_QA DB_PASS_QA DB_USER_PROD DB_PASS_PROD
3. Choose the needed pipeline and go to Settings located above the Console tab.
4. Select DMC Database, and then select Force Sync.
If your DMC database is not configured and the project is not registered, the Force Sync button will be inactive. Thus, select Configure DMC DB, and after configuring it, select Register Project. You can also configure your DMC database and register your project by referring to Install and Register your Project with DMC documentation.
dbDef, dmcDbDef, and Force Sync
dbDef
and dmcDbDef
are XML tags in the datical.project
file. Each dbDef
tag defines the connection information to one database. See the example:
<dbDefs xsi:type="dbproject:SqlServerDbDef" name="DEV" driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" hostname="demo.datical.net" port="1433" username="DATICAL_USER" password="xxxxxxx" contexts="DEV" storageOptionCollectedAtSnapshot="true" labels="release" dbDefsId="eded7b74-25be-3ef4-bd03-c85a7a98f7a9" databaseName="DEMO" integratedSecurity="false" applicationName="Datical DB"/>
dmcDbDef
defines the connection information to the DMC database, which is related to a PostgreSQL database in the following example:
<dmcDB xsi:type="dbproject:PostgresqlDbDef" name="DMCDB" driver="org.postgresql.Driver" hostname="postgres.datical.net" port="5432" username="postgres" password="xxxxxxx" dbDefType="dmcdb" database="datical_dmc"/>
When running the forceSync
command, the information from dmcDbDef
is used to first connect to the DMC database. Once the connection is established, then the information from all dbDef
tags is sent to the DMC database. This new information is now used to build the DMC dashboards where blocks represent each dbDef
: