VCSI: Example Setups

The options described in the Version Control System Integration topic can be used in several different scenarios and do not necessarily have to be used together. This section describes two potential setups.

System Comparison

You can use the OIEP options to have the configuration from each system in a Development, Testing, Acceptance, and Production (DTAP) environment published to different branches in a remote Git repository, allowing for easy manual comparison of configurations using the 'diff' tools Git offers.

Systems can publish their configurations with scheduled intervals or on demand either via workbench or by invoking the OIEPs remotely via REST using the resource operation available in the STEP REST API (accessible from the Technical Documentation, at [system]/sdk or from the Start Page).

Such a setup can be used to ensure systems are in sync or only have expected differences. If differences are found, STEPXML files held in the Git branches can manually be imported one-by-one on a system that needs to be updated, or alternately, multiple files can be zipped and supplied to an IIEP configured to use the 'STEPXML Joiner' pre-processor described in the VCSI: STEPXML Joiner Pre-processor Options in IIEP topic.

Note: The VCS integration functionality offers no automatic dependency handling, which means that it is the responsibility of the user transferring files to ensure that all files necessary to create / update configuration objects are included and, given that the 'STEPXML Joiner' pre-processor is not used, that files are imported in the correct order.

With this setup, a tool like Jenkins https://jenkins.io/ could be used to monitor the branches for changes. With a monitoring tool, diff reports can be sent to users via email.

Branch comparisons can be made using the Git command line tool (for example, refer to https://git-scm.com/docs/git-diff), or, if a tool like Bitbucket is used, via a web interface as shown below.

Semi-Automated System Synchronization

With a tool like Jenkins configured to monitor branches for changes, instead of sending diff reports to users, a Jenkins job could be used to automatically keep systems in sync. The diagram below illustrates a setup where changes on STEP system 'SYS A' are automatically deployed on another STEP system 'SYS B'.

For this to work, a Jenkins job must monitor the 'SYS A' branch for changes, and when such changes are identified, the job must compare the 'SYS A' branch with the 'SYS B' branch. The job then produces a .ZIP file containing files from the 'SYS A' branch that differ, and passes the .ZIP file to an IIEP on 'SYS B' configured to use the 'STEPXML Joiner' and 'Invoke OIEP' options.

An example Jenkins job 'Build' shell script ($gituser, $gitpassword and $sysbpassword, $sysbuser defined via 'Username and password (separated)' bindings) is shown below:

#!/bin/bash
timestamp=$(date +%s)
gitserver='bitbucket.org/john-smith/step-conf.git'

sysbstepserver='sys-b.domain.com'
hotfolder='/upload/hotfolders/ConfigurationManagement/in'


git clone https://$gituser:$gitpassword@$gitserver checkout_$timestamp
cd checkout_$timestamp
git checkout $sys-b
git checkout $sys-a
git pull
git diff -z $sys-b..sys-a --name-only --diff-filter=ACMRT | xargs -0 zip cpg_diff_$timestamp.zip
sshpass -p $sysbuserpassword scp cpg_diff_$timestamp.zip $sysbuser@$sysbstepserver:$hotfolder

Important: As GitHub and Bitbucket do not support Basic authentication (that is, using a user name and password in the URL), replace the value of $gitpassword with a Personal Access Token (in the case of GitHub) or an App Password (in the case of Bitbucket.)

Via REST, the Jenkins job could also invoke the IIEP on 'SYS B' and monitor the import process, notifying human users if errors occur. Alternately, the IIEP could be scheduled to run frequently, and an error reporter could be used to notify users about errors.

Note: For a setup like this, be aware that the 'STEP Importer' processing engine cannot handle all updates. Refer to the VCSI: Considerations and Limitations topic for more information.