...
In the datical.project file the best practice is to create a separate REF database for the pipeline but it is possible to share a REF database between two pipelines.
If you are sharing a REF database, the best practice is to setup a separate dbDef, eg. REF_PIPELINE2.
Set the appropriate label on any new dbDef. The label should be the name of the pipeline, eg. pipeline2.
Set the appropriate contexts on the dbDef, eg. REF,REF_PIPELINE2.
For each of the databases in the pipeline, add new dbDefs. They can point to the same database, but give them unique names, eg. DEV_PIPELINE2, QA_PIPELINE2, Production_PIPELINE2.
Note if you are copying from existing dbDefs be sure to clear out the dbDefsId values.
Set the appropriate label on any new dbDef. The label should be the name of the pipeline, eg. pipeline2.
Set the appropriate contexts on the dbDef, eg. DEV_PIPELINE2, QA_PIPELINE2, Production_PIPELINE2,
In the datical.project file add a new plan/pipeline, eg. Pipeline2, with the desired databases. These should be the dbDefs with eg. REF_PIPELINE2, DEV_PIPELINE2, etc.
Note if you are copying from existing plans be sure to clear out the plansId values.
For the databases, add a new Tracking Schema to the REF database and all databases in the pipeline, eg. LIQUIBASE2.
In the datical.project file update the trackingSchema value to be parameterized, eg. trackingSchema="${TRACKING_SCHEMA}"
In the changelog/changelog.xml file, add the TRACKING_SCHEMA values. These go in the top of the changelog before the first <changeSet> tag.
Code Block <property context="REF1" labels="" name="TRACKING_SCHEMA" value="LIQUIBASE"/> <property context="REF1REF_PIPELINE2" labels="" name="TRACKING_SCHEMA" value="LIQUIBASE2"/> <property context="DEV" labels="" name="TRACKING_SCHEMA" value="LIQUIBASE"/> <property context="DEV_PIPELINE2" labels="" name="TRACKING_SCHEMA" value="LIQUIBASE2"/> <property context="QA" labels="" name="TRACKING_SCHEMA" value="LIQUIBASE"/> <property context="QA_PIPELINE2" labels="" name="TRACKING_SCHEMA" value="LIQUIBASE2"/> <property context="Production" labels="" name="TRACKING_SCHEMA" value="LIQUIBASE"/> <property context="Production_PIPELINE2" labels="" name="TRACKING_SCHEMA" value="LIQUIBASE2"/>
For the deployPackager.properties file, add code for the new pipeline.
Code Block # pipelne2 pipeline pipeline2.sqlScmLastImportID=<set with commitID> pipeline2.sqlScmBranch=branch2 # Do not need this line if using directory scmBranchHandling
You will need to configure your CI/CD tool to be able to trigger Packager for the correct pipeline based on some type of branch name structure, eg.
Code Block if [[ $(Build.SourceBranchName) == branch2 ]] then hammer groovy deployPackager.groovy pipeline=pipeline2 commitPrefix="[skip ci]" scm=true labels=$(Build.BuildId),pipeline2,$(Build.SourceBranchName) else hammer groovy deployPackager.groovy pipeline=main commitPrefix="[skip ci]" scm=true labels=$(Build.BuildId),main,$(Build.SourceBranchName) fi if [ $? -ne 0 ]; then exit 1; fi
...