Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Steps to perform in the TEST Environment

The below example assumes that 

  • a top-level folder Accounting is used in the JOC Cockpit inventory,
  • this folder is mapped to a sub-directory with the same name and spelling in the file system,
  • this folder is created when setting up the repository otherwise it will be created by JOC Cockpit the first time that objects should be stored to the repository.

Store Scheduling Objects to local Git Repository

...

Code Block
languagepowershell
titleExample how to store changes to a local Git repository
linenumberstrue
Import-Module JS7
Connect-JS7 -Url http://root:root@test-host:4446 -Id Controller | Out-Null

# Cleanup local repository by removing existing objects
Remove-JS7RepositoryItem -Folder /Accounting

# Store scheduling objects of the given folder and exclude draft versions to be used
Set-JS7RepositoryItem -Folder /Accounting -Recursive -NoDraft

Explanation:

  • Line 2: A number of ways are offered how to connect to JOC Cockpit, see JS7 - How to connect to JOC Cockpit using the PowerShell Module.
  • Line 5: The Accounting top-level folder and any sub-folders are removed from the local repository, for details see Remove-JS7RepositoryItem. This step is not required, however, it can be useful for consistency if scheduling objects that have been removed or renamed in the JOC Cockpit inventory.
  • Line 8: The Accounting top-level folder and any sub-folders are added to the local repository, see Set-JS7RepositoryItem.

Commit and push Changes to remote Git Repository

The following OS and Git commands are usedsuggest a typical sequence of steps:

Code Block
languagepowershell
titleExample how to commit and push changes to a remote repository
linenumberstrue
# Find the repository sub-directory managed by JOC Cockpit
cd /var/sos-berlin.com/js7/joc/jetty_base/resources/joc/repositories/rollout/Accounting

# Commit and push changes to the remote Git repository
git add .
git commit -m "changes to accounting jobs for v12.3"
git push

...

  • Line 11: The <commit-hash> identifies commits performed to push scheduling objects to the test repository. This step can be performed repeatedly to copy a number of commits.

Pull Changes to local Git Repository

...

Code Block
languagepowershell
titleExample how to store changes to a local Git repository
linenumberstrue
Import-Module JS7
Connect-JS7 -Url http://root:root@prod-host:4446 -Id Controller | Out-Null

# Update the JOC Cockpit inventory from the local repository of the given folder
Update-JS7FromRepositoryItem -Folder /Accounting

# Release scheduling objects of the given folder
Publish-JS7RelelasableItem -Folder /Accounting -Recursive -NoReleased

# Deploy scheduling objects from the given folder to the Controller
Publish-JS7DeployableItem -ControllerId Controller -Folder /Accounting -Recursive -NoDeployed

Explanation:

  • Line 5: The JOC Cockpit inventory is updated from the local repository. This translates to the fact that objects with the same name are overwritten and that new objects are added. Updated objects are put to a draft status in the JOC Cockpit inventory. Find details from Update-JS7FromRepositoryItem.
  • Line 8: Scheduling objects that are not deployed to a Controller such as schedules and calendars are released. Should such objects be included in the changes to the local repository then they are in a draft status and should be released. The -NoReleased parameter prevents scheduling objects in a non-draft status from being released, for example objects that are not stored in the local repository but that have previously been released.
  • Line 11: Scheduling objects are deployed to the given Controller. The -NoDeployed parameter prevents scheduling objects in a non-draft status from being deployed, for example objects that are not stored in the local repository but that have previously been deployed.