Versions Compared

Key

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

...

Controller Cluster
CommandObjectDocumentation
getlist-item / store-item / update-item / delete-item

JOC CockpitScheduling Objects such as Workflows

clone  / checkout

Git Repository

clone  / checkout

JOC Cockpit

JS7 - Agent Cluster
JS7 - Management of Standalone Agents
JS7 - Management of Agent Clusters



add / commit / push / pull
get-credentials / store-credentials / delete-credentials

...

  • list-item
    • Returns the list of scheduling objects from JOC Cockpit's Git repository. The list will be returned in JSON format.
    • The command is used alternatively
      • with the --path and --type options to specify an individual object. One of the following object types has to be specified:
        • Deployable object types: WORKFLOW, FILEORDERSOURCE, JOBRESOURCE, NOTICEBOARD, LOCK
        • Releasable object types: INCLUDESCRIPT, SCHEDULE, WORKINGDAYSCALENDAR, NONWORKINGDAYSCALENDAR, JOBTEMPLATE, REPORT
      • with the --folder option to include all objects in the related folder to be returned. The --recursive switch can be used to process sub-folders recursively.
  • store-item
    • Stores scheduling objects of JOC Cockpit's inventory to JOC Cockpit's Git repository.
    • The following switches can be used to limit objects that should be stored:
      • The --no-draft switch excludes draft objects from being stored to JOC Cockpit's Git repository.
      • The --no-deployed switch excludes deployed objects from being stored to JOC Cockpit's Git repository.
      • The --no-released switch excludes released objects from being stored to JOC Cockpit's Git repository.
    • Later commit and push commands will apply changes.
  • update-item
    • Updates the JOC Cockpit inventory from scheduling objects available in JOC Cockpit's Git repository.
  • delete-item
    • Deletes scheduling objects from JOC Cockpit's Git repository. The operation does not affect existence of objects in JOC Cockpit's inventory.

    • Later commit and push commands will apply changes.
  • clone
    • Clones a remote Git repository to a JOC Cockpit Git repository.
    • The command is used with the --remote-url option to identify the remote Git repository. Frequently the syntax git@<git-server>:<owner>/<repository> is used, for example: git@github.com:sos-berlin/js7-demo-inventory-rollout-test
  • checkout
    • A specific branch from the remote Git repository is checked out using the --branch or --tag options to identify the branch.
  • add
    • Adds changes to JOC Cockpit's Git repository.
  • commit
    • Commits changes to JOC Cockpit's Git repository.
    • The command is used with the --folder option to specify the inventory folder that is mapped to the Git repository. The --message option is used to specify a message that  typically becomes visible when displaying commits to a repository in a Git serverGit Server.
    • The command returns the commit hash created by Git when committing changes.
  • push
    • Pushes objects from JOC Cockpit's Git repository to the remote Git repository.
    • The command is used with the --folder option to specify the inventory folder that is mapped to the Git repository.
  • pull
    • Pulls objects from the remote Git repository to JOC Cockpit's Git repository. Objects in JOC Cockpit's Git repository will be removed, added or updated.
    • The command is used with the --folder option to specify the inventory folder that is mapped to the Git repository.
  • get-credentials
    • Reads Git credentials from the user's profile in JOC Cockpit.
    • If credentials for more than one Git Server are available then they will be returned.
  • store-credentials
    • Stores Git credentials to the user's profile in JOC Cockpit.
    • The command is used with the --server option to specify the Git Server for which credentials will be stored.
    • For authentication with Git one of the --user-password, --user-access-token or --user-private-key options must be used.
      • The location of a private key file must be specified from an absolute path that is readable for the JOC Cockpit service.
      • Users have to store the private key file to the related location.
  • delete-credentials
    • Deletes Git credentials from the user's profile in JOC Cockpit.
    • The command is used with the --server option to specify the Git Server for which credentials will be deleted.

...

Code Block
languagebash
titleExample for Managing Git Credentials
linenumberstrue
# common options for connection to JS7 REST API
request_options=(--url=http://localhost:4446 --user=root --password=root --controller-id=controller)

# get credentials
./deploy-git.sh get-credentials    "${request_options[@]}"

# store credentials
./deploy-git.sh store-credentials  "${request_options[@]}" --server=github.com --user-account=community \
                                                           --user-name="Community" --user-mail="community@sos-berlin.com" \
                                                           ---user-private-key=/var/sos-berlin.com/js7/joc/resources/joc/repositories/private/sos-community.rsa

# delete credentials
./deploy-git.sh delete-credentials "${request_options[@]}" --server=github.com

...

The operation will return the list of scheduling objects available in JOC Cockpit's Git repository.

Code Block
languagebash
titleExample for Listing Objects from a Git Repository
linenumberstrue
# common options for connection to JS7 REST API
request_options=(--url=http://localhost:4446 --user=root --password=root --controller-id=controller)

# list items from JOC GitCockpit rollout repository
./deploy-git.sh list-item    "${request_options[@]}" --folder=/TestRepo --recursive

Storing Scheduling Objects to a Git Repository

The operation will store scheduling objects from JOC Cockpit's inventory to JOC Cockpit's Git repository.



# list items from JOC Cockpit local repository
./deploy-git.sh list-item    "${request_options[@]}" --folder=/TestRepo --recursive --local

Storing Scheduling Objects to a Git Repository

The operation will store scheduling objects from JOC Cockpit's inventory to JOC Cockpit's Git repository.

Code Block
languagebash
title
Code Block
languagebash
titleExamples for Storing Scheduling Objects to a Git Repository
linenumberstrue
# common options for connection to JS7 REST API
request_options=(--url=http://localhost:4446 --user=root --password=root --controller-id=controller)

# store items to JOC Cockpit rollout respositoryrepository: folder
./deploy-git.sh store-item  "${request_options[@]}" --folder=/TestRepo --recursive

# store items to JOC Cockpit rollout respositoryrepository: object path and type of deployed object
./deploy-git.sh store-item  "${request_options[@]}" --path=/TestRepo/03_VariablesPassing/jdwVariablesAdHoc-repo --type=WORKFLOW --no-draft

# store items to JOC Cockpit local respositoryrepository: object path and type of draft object
./deploy-git.sh store-item  "${request_options[@]}" --path=/TestRepo/03_VariablesPassing/jdjVariablesJobResource --type=JOBRESOURCE --no-deployed --local

# store items to JOC Cockpit rollout respositoryrepository: object path and type of deployed or draft object
./deploy-git.sh store-item  "${request_options[@]}" --path=/TestRepo/51_JobTemplates/51_JobTemplate --type=JOBTEMPLATE

# store items to JOC Cockpit rollout respositoryrepository: folder limited to draft objects
./deploy-git.sh store-item  "${request_options[@]}" --folder=/TestRepo --recursive --no-released --no-deployed

# store items to JOC Cockpit rollout respositoryrepository: folder limited to deployed objects
./deploy-git.sh store-item  "${request_options[@]}" --folder=/TestRepo --recursive --no-released --no-draft

# store items to JOC Cockpit rollout respositoryrepository: folder limited to released objects
./deploy-git.sh store-item  "${request_options[@]}" --folder=/TestRepo --recursive --no-deployed --no-draft

...

Code Block
languagebash
titleExamples for Deleting Scheduling Objects from a Git Repository
linenumberstrue
# common options for connection to JS7 REST API
request_options=(--url=http://localhost:4446 --user=root --password=root --controller-id=controller)

# delete items from rolloutJOC Cockpitrollout repository: folder
./deploy-git.sh delete-item "${request_options[@]}" --folder=/TestRepo/03_VariablesPassing

# delete items from JOC Cockpit rollout repository: object path and type
./deploy-git.sh delete-item "${request_options[@]}"  --path=/TestRepo/03_VariablesPassing/jdwVariablesAdHoc-repo --type=WORKFLOW

# delete items from JOC Cockpit rollout repository: object path and type
./deploy-git.sh delete-item "${request_options[@]}"  --path=/TestRepo/51_JobTemplates/51_JobTemplate --type=JOBTEMPLATE

# delete items from JOC Cockpit local repository: object path and type
./deploy-git.sh delete-item "${request_options[@]}"  --path=/TestRepo/03_VariablesPassing/jdjVariablesJobResource --type=JOBRESOURCE --local

...

Code Block
languagebash
titleExamples for Updating the JOC Cockpit Inventory from a Git Repository
linenumberstrue
# common options for connection to JS7 REST API
request_options=(--url=http://localhost:4446 --user=root --password=root --controller-id=controller)

# update inventory items from JOC Cockpit rollout respositoryrepository: folder
./deploy-git.sh update-item "${request_options[@]}" --folder=/TestRepo

# update inventory items from JOC Cockpit local respositoryrepository: folder
./deploy-git.sh update-item "${request_options[@]}" --folder=/TestRepo --local

# update inventory items from JOC Cockpit rollout respositoryrepository: path and object type of object
./deploy-git.sh update-item "${request_options[@]}" --path=/TestRepo/03_VariablesPassing/jdwVariablesAdHoc-repo --type=WORKFLOW

Deploying Scheduling Objects from a Git Repository

The operation will update the JOC Cockpit's Git repository from inventory items and will push changes to the remote Git repository.

Code Block
languagebash
titleExample for Deploying Objects from a Git Repository
linenumberstrue
# common options for connection to JS7 REST API
request_options=(--url=http://localhost:4446 --user=root --password=root --controller-id=controller)

# store inventory items to JOC Cockpit rollout repository: folder
./deploy-git.sh store-item    "${request_options[@]}" --folder=/TestRepo --recursive

# add items to JOC Cockpit rollout repository
./deploy-git.sh add           "${request_options[@]}" --folder=/TestRepo

# commit changes to JOC Cockpit rollout repository and keep commit hash
hash=$(./deploy-git.sh commit "${request_options[@]}" --folder=/TestRepo --message="v.1.23.34")

# pull changes from remote repository to JOC Cockpit rollout repository
./deploy-git.sh pull          "${request_options[@]}" --folder=/TestRepo

# push changes from JOC Cockpit rollout repository to remote repository
./deploy-git.sh push          "${request_options[@]}" --folder=/TestRepo

Resources

...