0
votes

I need to create perforce clients from my jenkins build scripts, and this needs to be done unattended. This is mainly because jenkins jobs run in unique folders, Perforce insists that each client has a unique root target folder, and we create new jenkins jobs all the time based on need. Right now each time I create a unique jenkins job, I have to manually create a perforce client for that job - I can do this from the command line, but Perforce also insists on pausing the client creation to show me the specification settings file, which I need to manually close before the client is created.

To create the client I'm using

p4 -u myuser -P mypassword client -S //mydepo/mystream someclientname

and I'm using this awful hack to simultaneously kill notepad

p4 -u myuser -P mypassword client -S //mydepo/mystream someclientname | taskkill /IM notepad.exe /F

This sort of works, but it doesn't feel right. Is there an official/better way I can force p4 to silently force create a client?

2

2 Answers

0
votes

Do this:

p4 -u user -P ticket client -S //depot/stream -o someclientname | p4 -u user -P ticket client -i
0
votes

You can prepare client form upfront and pass the path by:

p4 client -i newClientForm.txt

I guess that you can have a script that prepare such file before calling p4 client.

Take a look on the default form that is popping up every time.

I don't know how you can deal with passing both options -S and -i though.