Is it possible to read the P4CLIENT setting that an agent is using?



1 comment

  • Avatar
    Anandha Krishnan

    Hello Yehoram,

    Currently Go generates the Client names at runtime. It is of the form "cruise-#{system-hostname}-#{working_dir}_#{hash_of_working_dir}". This behaviour cannot be controlled from configuration. (ie the value cannot be passed in).

    In order access to P4Client you can do the following on the agents. I guess you already have access to P4User.

    1) Write a new "p4" executable i.e. "" or "p4.cmd" and add it to the path before the actual executable. Inside that you:

    * Delegate every command to the real p4 command
    * Whenever we execute a "p4 client -i ..." command on the agent, capture the client name and for that run of the job use that as the client name.

    2) If you know that the working directory and the hostname of the agent on which you are executing does not change, you can, for now, use the "p4 clients" command and figure out what client matches the above mentioned format and use it hard coded in the build.

    Please let us know if you need help with anything specified above.

    Also for your reference , the documentation link below explains how what Go does in the "Notes" section.

    Go Dev Team.

    Comment actions Permalink

Please sign in to leave a comment.