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

Follow

Comments

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. "p4.sh" 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.


    http://www.thoughtworks-studios.com/go/2.1/help/configuration_reference.html#p4


    Go Dev Team.

Please sign in to leave a comment.