You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Introduction

Continuous Integration / Continuous Delivery (CI/CD) is a supported method for JS7 - Rollout of Scheduling Objects.

  • The scenario is described with the JS7 - Git Repository Interface.
  • CI/CD includes to perform the following steps
    • in a test environment
      • to store scheduling objects of a JOC Cockpit inventory to a local Git repository,
      • to commit and to push changes to the remote Git repository.
    • in a prod environment
      • to copy changes from the remote test Git repository to the remote prod Git repository,
      • to pull changes from the remote prod Git repository to the local Git repository,
      • to update the JOC Cockpit inventory from the local Git repository,
      • to release and to deploy scheduling objects to Controllers and Agents.

Steps to perform in the TEST Environment

Store Scheduling Objects to local Git Repository

The following cmdlets are used:

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

# Cleanup 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

Commit and push Changes to remote Git Repository

The following OS and Git commands are used:

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

# Follows the Git integration part
git add .
git commit -m "changes to accounting jobs for v12.3"
git push

Steps to perform in the PROD Environment

Copy Changes from TEST to PROD Git Repository

There are a number of ways how to achieve this using Git commands:

Example how to pull changes to a local Git repository
# add the old repo as a remote repository 
git remote add oldrepo https://github.com/path/to/oldrepo

# get the old repo commits
git remote update

# examine the whole tree
git log --all --oneline --graph --decorate

# copy (cherry-pick) the commits from the old repo into your new local one
git cherry-pick sha-of-commit-one
git cherry-pick sha-of-commit-two
git cherry-pick sha-of-commit-three

# check your local repo is correct
git log

# send your new tree (repo state) to github
git push origin master

# remove the now-unneeded reference to oldrepo
git remote remove oldrepo

Pull Changes to local Git Repository

The following OS and Git commands are used:

Example how to pull changes to a local Git repository
# Find the repository sub-directory managed by JOC Cockpit
cd /var/sos-berlin.com/js7/joc/jetty_base/resources/joc/repositories/rollout/Accounting

# Pull changes
git pull

Update JOC Cockpit Inventory from local Git Repository, Release and Deploy to Controller

The following cmdlets are used:

Example how to store changes to a local Git repository
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

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




  • No labels