Search Unity

Question Plastic Cloud and Jenkins PlasticSCM

Discussion in 'Unity Version Control' started by JaySFlux, Mar 14, 2023.

  1. JaySFlux

    JaySFlux

    Joined:
    Feb 13, 2023
    Posts:
    5
    Hello,

    We're running Plastic Cloud and I am trying to configure the PlasticSCM Jenkins plugin (https://plugins.jenkins.io/plasticscm-plugin/), however, when running my build it get stuck in an input wait. This is the log of the build, after presenting the options it just keeps waiting for an input
    Code (CSharp):
    1. [PlasticTest] $ /var/jenkins_home/tools/plasticscm-cli/PlasticSCM/cm workspace list --format={wkname}#{path}#{wkid} -wks=XXXXXXXXXX@cloud --workingmode=LDAPWorkingMode --username=XXXXXXXXXX ********
    2. [PlasticTest] $ /var/jenkins_home/tools/plasticscm-cli/PlasticSCM/cm workspace create jenkins_0e9bb4edc91c4b44a6d27721a4886c1e /var/jenkins_home/workspace/PlasticTest --selector=/var/jenkins_home/workspace/PlasticTest/selector4983248213861570241.txt -wks=XXXXXXXXXX --workingmode=LDAPWorkingMode --username=XXXXXXXXXX  ********
    3.  
    4. Getting organization providers...
    5. Select the system you want to use to sign in to the organization: XXXXXXXXXX
    6. 0 - unityid
    7. 1 - email
    The job is set to use LDAP/Cloud authentication and I am using my UnityID credentials. If I use the same credentials on my Plastic client they work, so they should be correct. Not sure what I should do next?

    Thanks!
     
    Last edited: Mar 14, 2023
  2. carlosalba1985

    carlosalba1985

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    1,064
    Hi,

    I'm afraid there is not an easy way to configure UnityID via CLI if you don't have a web browser in the build machine for login. Do you have it?
    We have planned a solution for Unity ID login based on tokens, but I'm afraid it's not still available.

    1. You could use a user/password to login into the build machine while you keep using the Unity ID in the Plastic client.

    2. If you need to use Unity ID in the build machine, as a workaround, you could configure the Plastic client on a Windows machine and then paste the configuration files to the build machine:
    C:\Users\xxx\AppData\Local\plastic4\client.conf
    C:\Users\xxx\AppData\Local\plastic4\profiles.conf
    C:\Users\xxx\AppData\Local\plastic4\tokens.conf
    C:\Users\xxx\AppData\Local\plastic4\cloudregions.conf

    Sorry for the inconvenience.

    Regards,
    Carlos.
     
  3. JaySFlux

    JaySFlux

    Joined:
    Feb 13, 2023
    Posts:
    5
    "I'm afraid there is not an easy way to configure UnityID via CLI if you don't have a web browser in the build machine for login. Do you have it?"

    I don't, it's a jenkins build machine running on Docker. And I can't run cm configure on the jenkins machine, I keep getting the "Couldn't find a valid ICU package installed on the system.", even though I have "Use invariant .NET globalization" checked

    Also in my local Windows machine, where I have the Plastic SCM installed (and I ran cm configure) I can't seem to find any of the .conf files you've listed. The only one I can find is "C:\Program Files\PlasticSCM5\client\config_samples\client.conf"
     
  4. carlosalba1985

    carlosalba1985

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    1,064
    In order to use the Jenkins plugin, you will need to install and configure a Plastic client on that machine. After the Plastic is installed, you should be able to use the PlasticCLI client.
    I'm afraid we don't have official support for Docker. I know there were some initiatives to support Docker in the past, but not sure if it will still work: https://github.com/PlasticSCM/plastic-docker

    Assuming you don't have a web browser, I could configure the client to use an email/plassword user at plasticscm.com instead of Unity ID.
     
  5. JaySFlux

    JaySFlux

    Joined:
    Feb 13, 2023
    Posts:
    5
    So I am now running Jenkins directly on my local Windows machine, but still facing the same problem... I have found the .conf files you have mentioned but I am not quite sure where I should copy them... I tried copying them to the same folder where cm.exe is installed in my local machine, but then when running the job on jenkins I am getting a invalid credentials error (even though they are correct)
     
  6. carlosalba1985

    carlosalba1985

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    1,064
    So you are trying to run Jenkins with the Plastic plugin on a Windows machine (not Docker) now, right?

    After configuring the Plastic client, could you try to list the repos on a console?
    cm repository list

    Let's debug first if the Plastic client is properly configured and it can list the repos.
     
  7. JaySFlux

    JaySFlux

    Joined:
    Feb 13, 2023
    Posts:
    5
    Thanks for the help :)

    That is correct: Docker is no longer part of the equation

    running cm repository list gives me a list of all the repos in my Plastic cloud server, including the one I have configured in the Plastic plugin job in Jenkins (code-review-test@XXXXXXXXXX@cloud)

    Here's how the selector form my job looks like


    repository "code-review-test@XXXXXXXXXX@cloud"
    path "/"
    smartbranch "/main"

    EDIT

    So, copying only

    C:\Users\xxx\AppData\Local\plastic4\client.conf
    C:\Users\xxx\AppData\Local\plastic4\profiles.conf
    C:\Users\xxx\AppData\Local\plastic4\tokens.conf

    it worked!
     
    Last edited: Mar 15, 2023
  8. carlosalba1985

    carlosalba1985

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    1,064
    Thanks for the update! :)
     
  9. AlgoritcomDev

    AlgoritcomDev

    Joined:
    Aug 5, 2023
    Posts:
    7
    Where did you copy the authentication files?
     
  10. carlosalba1985

    carlosalba1985

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    1,064
    You need to copy them to the client binaries folder:

    C:\Program Files\PlasticSCM5\client\client.conf
    C:\Program Files\PlasticSCM5\client\profiles.conf
    C:\Program Files\PlasticSCM5\client\tokens.conf
     
    AlgoritcomDev likes this.