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

Compare with Current View Page History

« Previous Version 10 Next »

Introduction

JS7 offers JS7 - Inventory Git Integration for JS7 - Rollout of Scheduling Objects.

The steps to set up access to a Git Server can be manually applied and can be applied by use of the JS7 REST Web Service API.

Manual Setup

Git Configuration File

JOC Cockpit makes use of a Git client that reads configuration items from the following file (assuming a user account me being in place)

  • for Unix environments:
    • /home/me/.ssh/config
  • for Windows environments:
    • C:\Users\me\.ssh\config

The Git config file can look like this:

Example for Git config file
Host github.com
    Hostname github.com
    IdentityFile C:\Users\me\.ssh\github_rsa
    IdentitiesOnly yes

Explanation:

  • The settings maps use of a private key file to authentication with a Git Server.

Git Configuration Items

A typical configuration step performed with a Git client looks like this:

Example for Git config file
# Specify user name
git config --global user.name "My Account"

# Specify e-mail address
git config --global user.email "myAccount@example.com"

# Use simple merge strategy
git config --global push.default simple

Automation with the JS7 REST Web Service API

Users who whish to automate the steps to set up Git access can use the following resources:

Find the documentation for related cmdlets from PowerShell CLI 2.0 - Cmdlets - Git Repository Integration.

FEATURE AVAILABILITY STARTING FROM RELEASE 2.3.0

Example for use of PowerShell cmdlets
# parameterization
$gitServer   = 'github.com'
$gitAccount  = 'myAccount'
$gitUserName = 'My Account'
$gitUserMail = 'myAccount@example.com'
$gitKeyFile  = 'myKey.rsa'

# use of private key file
Add-JS7GitCredentials -Server $gitServer -Account $gitAccount -KeyFile $gitKeyFile -UserName $gitUserName -UserMail $gitUserMail

# use of access token (similarly insecure as use of passwords)
# Add-JS7GitCredentials -Server $gitServer -Account $gitAccount -AccessToken 'a1b2c3d4e5f6g7h8' -UserName $gitUserName -UserMail $gitUserMail

# use of password (denied by a larger number of Git Servers)
# Add-JS7GitCredentials -Server $gitServer -Account $gitAccount -Password (ConvertTo-SecureString 'secret' -AsPlainText -Force) -UserName $gitUserName -UserMail $gitUserMail

# remove Git credentials
Remove-JS7GitCredentials -Server $gitServer


Explanation:



  • No labels