Jump to content

Plastic Sync -> GitSync trigger for an individual repo?


Recommended Posts

I've been reading up on Triggers but I'm not sure I'll be able to achieve my goal.

What I would like to do is, after a sync operation completes (on the destination server), for a single repo (not all the repos), I would like that server to then perform a subsequent GitSync from that repo into Azure DevOps.

Does anyone know how to set this up, or if it is even feasible.

Link to comment
Share on other sites

Hi, 

There is an "after-replciationwrite" trigger you may use in this scenario:

https://www.plasticscm.com/documentation/triggers/plastic-scm-version-control-triggers-guide#Replicationwrite

You can include the gitsync command in this trigger. The trigger will be asynchronous so the push is not locked until the gitsync is finished.

Regards,

Carlos.

Link to comment
Share on other sites

  • 3 weeks later...

So is there no way to trigger after a sync is complete? Won't the after-replicationwrite trigger go off on every replicated branch no matter the repo being replicated (possibly firing multiple times)? I was really hoping to limit the gitsync to only firing after a sync is complete on a specific repo.

Link to comment
Share on other sites

So I did some confirmation testing, and it looks like it will fire multiple times... I might be able to write a script to fire a gitsync after one or more replicationwrites are detected on the repo (which I would extract from the PLASTIC_BRANCH environment variable), but only after a period of inactivity. Which would hopefully be enough to indicate that the complete sync is finished.

What are the chances we could get a new triggers for before-sync and after-sync added into Plastic SCM? Is this a feasible trigger?

Link to comment
Share on other sites

As you comment, the goal is to use the environment variables to use the "PLASTIC_BRANCH" and "PLASTIC_REPLICATION_SOURCE"  to select the repo and branch where you want to run the triggers.

It will fire every time you replicate a branch. Isn't it the expected behavior? If you are replicating multiple branches, you could get them in your trigger script and only run the GitSync when the last branch is replicated.

Regards,

Carlos.

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...