# --- Parameterization --- $url = 'http://root:root@localhost:4246' $controllerId = 'jobscheduler' $folder = '/TestRepo/testMyFolder' $directory = 'C:\ProgramData\sos-berlin.com\js7\joc\jetty_base\resources\joc\repositories\rollout\TestRepo' # --- Connection --- Import-Module JS7 Connect-JS7 -Url $url -Id $controllerId | Out-Null # --- Step 1: Check status of releasable and deployable objects --- $items = Get-JS7ReleasableItem -Folder $folder -NoReleased if ( $items.count ) { Write-Warning "CI/CD pipeline stopped: unreleased objects found:" foreach( $item in $items ) { Write-Warning "unreleased object: type=$($item.objectType), valid=$($item.valid), folder=$($item.folder), name=$($item.objectName)" } # optionally release items $items | Publish-JS7ReleasableItem } # $items = Get-JS7DeployableItem -Folder $folder -NoDeployed if ( $items.count ) { Write-Warning "CI/CD pipeline stopped: undeployed objects found:" foreach( $item in $items ) { Write-Warning "undeployed object: type=$($item.objectType), valid=$($item.valid), folder=$($item.folder), name=$($item.objectName)" } # optionally deploy items $items | Publish-JS7DeployableItem -ControllerId $controllerId } # --- Step 2: Cleanup repository and store scheduling objects to repository --- # Cleanup local repository by removing existing objects Remove-JS7RepositoryItem -Folder $folder # Store scheduling objects of the given folder and exclude draft versions to be used Set-JS7RepositoryItem -Folder $folder -Recursive -NoDraft # --- Step 3: add objects, commit and push to remote repository cd $directory git add . git commit -m "changes to accounting jobs for v12.3" git push # --- Connection --- Disconnect-JS7