Introduction
- JS7 JOC Cockpit can be configured to interface with Git repositories to store its configuration objects such as workflows and jobs.
- Configuration objects can be versioned (tagged) and can be rolled out to different JS7 instances via Git. This allows to create and to test workflows in a development environment and to perform a rollout to a production environment by use of a Git repository.
- JOC Cockpit is the leading system to store configuration objects in its database. A connection to a Git repository is considered an additional option to manage versions and rollouts of JS7 configuration objects.
Object Mappings
Configuration Objects
JS7 configuration objects that can be added to a Git repository include
- Workflows
- Locks
- File Order Sources
- Notice Boards
Such objects can be managed with JS7 in a way that allows to re-use the objects - without any changes - across rollout environments such as dev, test, prod.
The following configuration objects typically hold configuration items that can be specific for an individual rollout environment and therefore optionally can be excluded from a Git repository.
- Job Resources
- Calendars
- Schedules
Configuration Mappings
The JS7 inventory is organized by folders.
- Folders hold configuration objects such as workflows etc. and any level of sub-folders.
- Folders are the basic unit for JS7 - Permissions, for example, users can be granted access to specific folders only.
- Folders allow to perform bulk operations such as to deploy, to release, to remove and to rename configuration objects.
Folders can be mapped to Git repositories managed by the same or by different Git servers like this:
The mapping of folder objects to repositories implies
- user access:
- users with JS7 access permissions to manage folders and to access the Git repository can manage configuration objects in JOC Cockpit and can commit, push, pull configuration objects to/from Git,
- users with JS7 access permissions to manage folders but without access to the Git repository can manage configuration objects in JOC Cockpit,
- users with JS7 access permissions to view folders do not require Git access.
- folder usage:
- if a single Git repository should be used then all folders have to be available from a single root folder,
- for use with a number of Git repositories each folder maps to a different repository,
- folders can remain without Git integration for local management and deployment.
JOC Cockpit maps folders to Git repositories and stores the respective Git repository URL for each folder in its inventory.
Git Access
User Access
Each user holds an individual set of credentials to connect to a Git server.
The following settings are stored with a user's profile:
git_account
- account that is used to connect to a Git server
git_key
- the user's private key for Git access
git_access_token
- the access token for Git access that works as an alternative to use of a private key
If repositories are used from a number of Git servers that require different sets of user credentials then separate user accounts in JOC Cockpit have to be used.
Repository Access
- The JS7 - REST Web Service API executes a set of Git operations by use of the JGit implementation.
- Any operations to add configuration objects to a repository, to commit, push, pull and merge objects are available from the JS7 REST Web Service API.
- The JOC Cockpit offers the user interface for respective Git operations.
- Users are free to use additional tools such as Git Extensions to manage repositories and branches.
Git Operations
Management
JS7 configuration objects are managed in a Git repository via the JS7 REST Web Service API.
To this purpose JOC Cockpit holds a local repository per user in the JETTY_BASE/resources/joc/repo
folder. For each user with Git access a sub-directory is created from the name of the user account that holds the local repository.
- The local user repository is automatically created when a user connects to a Git repository via JOC Cockpit.
- The local user repository is persistent and is updated from the JOC Cockpit database (commit) and from the Git repository (pull).
- The JS7 - Cleanup Service removes any local user repositories if the user profile no longer exists, i.e. if a user is dropped from JOC Cockpit.
The following operations are available:
git-add
- adds (new) configuration objects from the JOC Cockpit database to the local user repository
git-delete
- removes an already added configuration object from the local user repository
git-commit
- commits newly added, updated or removed configuration objects to a local user repository
git-push
- pushes changes from the local user repository to the remote Git repository
Versioning
Versioning of JS7 configuration objects is performed by use of the tagging capabilities of Git.
The JS7 REST Web Service API manages the Git tagging process.
The following operations are available:
git-tag
- tags the current commit with a version label
git-push
- see above
Rollout
Rollout between different JS7 instances can be performed by use of the Git functionality.
The JS7 REST Web Service API manages the processes for checkout and cloning.
The following operations are available:
git-checkout
- checks out a specific branch or tag from the Git repository
git-clone
- initially clones a Git repository to a local user repository
git-pull
- pulls recent changes from the Git repository to the local user repository
Force Overwrite
Forcefully overwrites a target configuration with the source configuration in use.
The JS7 REST Web Service API manages to forcefully overwrite configuration objects in the Git repository.
The following operations are available depending on the force direction:
- JS7 JOC Cockpit instance => Git repository
git-add
- adds (new) configuration objects from the JOC Cockpit database to the local user repository
git-delete
- removes an already added configuration object from the local user repository
git-commit
- commits newly added, changed or removed configuration objects to a local user repository
git-push
- pushes changes from the local user repository to the Git repository
- Git repository => JS7 JOC Cockpit instance
git-checkout
- checks out a specific branch or tag from the Git repository to the local user repository
git-clone
- initially clones a Git repository to a local user repository
git-pull
- pulls recent changes from the Git repository to the local user repository
Note
If merging of configuration objects between different Git repositories or between different branches of a single Git repository is required then additional tools such as Git Extensions can be used.
Use Cases
Single Client - Single Branch
Scenario
- Architecture
- A single JOC Cockpit instance is used with a single Controller or optionally with separate Controllers and Agents for rollout environments such as dev, test, prod.
- The Git repository is used per folder to hold a copy of JS7 configuration objects and to create versions of JS7 configuration objects in a single branch.
- Users
- All users act in the same JOC Cockpit instance that is a single client to the Git server.
- Changes to the Git repository are performed by the users' individual accounts and are added to a single branch.
- Rollout
- Deployments are performed from a single source (JOC Cockpit) to a number of Controllers and Agents (dev, test, prod).
- The Git repository can be used to fallback (pull) to previous versions of configuration objects, however, only one version is available with JOC Cockpit at a given point in time.
Repository Operations
- management
- versioning
- rollout
Requirements
- The JOC Cockpit database is the leading system that holds the configuration objects.
Single Client - Multiple Branches (dev, test, prod)
Scenario
- Architecture
- A dedicated JOC Cockpit instance is used with Controller and Agents for each rollout environment such as dev, test, prod.
- The same Git repository is used per folder by all JOC Cockpit instances, however, each instance is acting on a specific branch per rollout environment.
- The Git repository is used to hold a copy of JS7 configuration objects, to create versions of JS7 configuration objects and to merge branches such as dev => test, test => prod.
- Users
- All users act in the same JOC Cockpit instance of the respective rollout environment that is a single client to the Git server.
- Changes to the Git repository are performed by the users' individual accounts and are added to each branch such as dev, test, prod.
- Rollout
- Deployments are performed from a single source (JOC Cockpit) to each Controller and Agents per rollout environment (dev, test, prod).
- The Git repository is used to merge branches and to rollout JS7 configuration objects to different Controllers and Agents, such as dev => test => prod.
- The Git repository can be used to fallback (pull) to previous versions of configuration objects, however, only one version is available with a given JOC Cockpit instance at a given point in time.
Repository Operations
- management
- versioning
- rollout
- force overwrite
Requirements
- The JOC Cockpit database holds the configuration objects:
- each JOC Cockpit instance is connected to its own database,
- each Git branch is mapped to an individual JOC Cockpit instance,
- the database can be updated from a Git branch.
- each Git branch makes use of its own version of configuration objects.
Multiple Clients - Multiple Branches (dev, test, prod)
Scenario
- Architecture
- A dedicated JOC Cockpit instance is used with each Controller and Agents for each user in the dev rollout environment.
- A dedicated JOC Cockpit instance is used with each Controller and Agents for all users in the test and prod rollout environments.
- The same Git repository is used per folder by all JOC Cockpit instances, however, each instance is acting on a specific branch per rollout environment.
- The Git repository is used to hold a copy of JS7 configuration objects, to create versions of JS7 configuration objects and to merge branches such as dev => test, test => prod.
- Users
- Users act in individual JOC Cockpit instances of the dev rollout environment as multiple clients to the Git server.
- Users act in the same JOC Cockpit instance of the test and prod rollout environment as a single client to the Git server.
- Changes to the Git repository are performed by the users' individual accounts to a each branch.
- Rollout
- Deployments are performed from a single source (JOC Cockpit) to the connected Controller and Agents per rollout environment (dev, test, prod).
- The Git repository is used to merge branches and to rollout JS7 configuration objects to different Controllers and Agents, such as dev => test => prod.
- The Git repository can be used to fallback (pull) to previous versions of configuration objects, however, only one version is available with a given JOC Cockpit instance at a given point in time.
Operations
- management
- versioning
- rollout
- force overwrite
Requirements
- The JOC Cockpit database holds the configuration objects:
- each JOC Cockpit instance is connected to its own database.
- each Git branch is connected to one or more JOC Cockpit instances.
- Each branch makes use of an individual version.
- Each user (client) makes use of an individual JS7 instance using JOC Cockpit and database, Controller and Agents