Search Unity

Inject credentials for package on private repo

Discussion in 'Package Manager' started by trnq1ll0, Apr 2, 2021.

  1. trnq1ll0

    trnq1ll0

    Joined:
    Aug 30, 2019
    Posts:
    49
    Hi, I am looking for ways to start Unity projects in our CI stack that depend on packages on private GitHub accounts. Interaction with Unity to pass the credentials at startup is not possible on the server. What are the alternative ways to do this? Thanks for your help.
     
  2. UnityMaru

    UnityMaru

    Community Engagement Manager PSM

    Joined:
    Mar 16, 2016
    Posts:
    1,227
    Hey there. Are you able to clarify what you mean by this: "Interaction with Unity to pass the credentials at startup is not possible on the server".

    If you are able to setup the CI so that a normal "git clone" command would work from the command line, then Packman should be able to clone the packages too.

    For example, if cloning via ssh, you would need to populate the CI builder with their private key in "~/.ssh/id_rsa
     
  3. trnq1ll0

    trnq1ll0

    Joined:
    Aug 30, 2019
    Posts:
    49
    Hi Maru,

    thanks for your answer. With "Interaction with Unity to pass the credentials at startup is not possible on the server" I was thinking that at startup of Unity the credentials for a private repo must be passed via UI. But this is not possible on the CI server.

    In the meantime I also think that in Github Actions we simply have a Github secret that contains the public key to our private repo, which is simply written to the .ssh/id_rsa when the server is started and should therefore be used when logging in to the Git server via ssh. I haven't tried it yet, but theoretically it should work.