Jump to content

Syncview through CLI


Occuros

Recommended Posts

Hey @calbzam

unfortunately these two possibilities don't help in my scenario.

We have multiple times a year new students coming in. We already could setup all the repository and permission management throug cli which helped a lot with automation.

 

The main thing we currently miss is to automate the sync view creation for the created repositories, if that could be achieved through CLI we have nearly everything automated.

 

Link to comment
Share on other sites

  • 1 year later...

I write my own PowerShell script to sync:

function Push-PlasticRepo {
    param (
        $repo,
        $sourceServer,
        $targetServer
    )

    $branches = & cm find branches on repositories "'$repo@$sourceServer'" --format='"{name}"' --nototal
    foreach ($branch in $branches) {
        & cm push $branch@$repo@$sourceServer $repo@$targetServer
    }
}

foreach ($repo in @("RepoA", "RepoB", "RepoC")) {
    Push-PlasticRepo $repo "localhost:8087" "ssl://xxx.net:8088"
}

And add it to Task Scheduler to automatically sync every night:

schtasks /create /f /tn "My\Sync Plastic Repos" /sc daily /st 04:00 /tr "powershell.exe -ex bypass 'xxx.ps1'"
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...