game4automation Posted October 23, 2020 Report Share Posted October 23, 2020 For integration in our Build process we would like to get the changeset number of the current changeset via Unity script. Is there an easy way to get it via the Plastic SCM Unity Plugin? Link to comment Share on other sites More sharing options...
calbzam Posted October 23, 2020 Report Share Posted October 23, 2020 Hi, - You could use the Plastic CLI client to get this information and query for the changeset id (eg: "cm find changeset"): https://www.plasticscm.com/documentation/cmfind/plastic-scm-version-control-query-system-guide Or do you want to get the changeset id your local workspace is pointing? - What build system are you using? Plastic has plugins for some CI tools (Jenkins, teamCity, Bamboo)... - In Plastic, you can also create custom triggers to be run linked to Plastic operations (eg: after-checkin😞 https://www.plasticscm.com/documentation/triggers/plastic-scm-version-control-triggers-guide Regards, Carlos. Link to comment Share on other sites More sharing options...
game4automation Posted October 23, 2020 Author Report Share Posted October 23, 2020 Hi, thanks a lot. We are using teamcity. We would like to get the changeset id of our current local workspace to use it in a Unity script Yes we could use "cm status --cset" and parse the result in a Unity Script. Do you have an example for a trigger script where the latest changeset id is always written to a text file or an environment variable? If would be perfect if the Plastic SCM Unity plugin will offer a simple api access for Unity scripts. For example to get the current changeset id or to subsribe a method which is called before the checkin and after the checkin. Regards Thomas Link to comment Share on other sites More sharing options...
calbzam Posted October 23, 2020 Report Share Posted October 23, 2020 Hi, Our trigger trigger guide includes some examples. If you plan to use "after-checkin" trigger, one of the available enviroment variables is: PLASTIC_CHANGESET Only available in the after-checkin trigger. The changeset or changesets that were created as a result of the checkin operation. This variable contains the specifications for the changesets that were created, separated by semi-colons (';'). This is a sample of a variable value with changesets created on two different repositories: cs:23@br:/main@rep:default@repserver:DARKTOWER:8084; cs:19@br:/main@rep:secondrep@repserver:DARKTOWER:8084 https://www.plasticscm.com/documentation/triggers/plastic-scm-version-control-triggers-guide#Checkin You can use this enviroment variable in your script. In Windows for instance, this is my sample "trigger.bat": echo %PLASTIC_CHANGESET% >> C:\tmp\changesets.txt Regards, Carlos. Link to comment Share on other sites More sharing options...
game4automation Posted November 18, 2020 Author Report Share Posted November 18, 2020 Hi I tried a trigger in the client (after-clientcheckin) but the trigger is not started after checkin. Do you have any idea why? Thanks & best regards Link to comment Share on other sites More sharing options...
calbzam Posted November 18, 2020 Report Share Posted November 18, 2020 Hi, I would check the following: 1. Review the trigger permissions to be sure your user has enough privilege to run it. 2. Create a very simple trigger: eg: output a string to a file and check if it works. 3. Review the Plastic client log to check the if there is any error in the log when running the trigger. Regards, Carlos. Link to comment Share on other sites More sharing options...
game4automation Posted November 18, 2020 Author Report Share Posted November 18, 2020 It might be a silly question. I am working with PlasticSCM Cloud. I can't figure out how to set and check the permissions there - did not found anything in the docs. Link to comment Share on other sites More sharing options...
calbzam Posted November 18, 2020 Report Share Posted November 18, 2020 Hi, If you are using Plastic cloud, only the webtriggers are supported (but not client-side or server-side triggers). You can check the details in the following link: http://blog.plasticscm.com/2020/06/web-triggers-for-plastic-scm-cloud.html Regards, Carlos. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now