1) What's the problem here? 1. Jenkins Perforce Workspace at /var/lib/jenkins/jobs/... - The name of this P4 workspace is whatever you have typed in the 'Workspace' field of your Jenkins project configuration -> Perforce section. I'm guessing you typed in 'jenkins_test'. - The P4 root of this P4 Workspace would be relative to your slave's Remot Root or your Jenkins Master (if you are running your project directly on Jenkins Master, and not on a slave). - Default behaviour is that Jenkins updates the P4 workspace with the Root and Host values, you can override this by checking the 'Don't update client workspace' option in the Advanced section.
2. Your Perforce workspace, 'jenkins_test', with root /home/maritn/p4/test Jenkins is not aware that you have such a P4 workspace created, and that you want to use it. As mentioned above, it will override Root and Host unless you ask it not to. Reco: 1. If you really can't go with the Jenkins chosen workspace to sync your p4 code to, don't use the option 'Don't update client workspace', instead use the 'custom workspace' in the Advanced project option, and change the workspace location to /home/martin/<somedir>, if you need to. Don't manage this Jenkins created P4 workspace outside this environment, let Jenkins manage it. (I'm assuming you can't get a slave machine, and need to run your jobs on the Master itself? Otherwise you can straightway set your Slave's remote root location to the right place that you want) 2. If you really need to use your Perforce client created outside for some reason, then use the command line within Jenkins config shell and do a manual sync such as P4 -c $yourclient 2) Does the user "jenkins" on Jenkins have anything to do with the Linux user who installed Jenkins and P4? No On Tuesday, July 21, 2015 at 3:36:32 PM UTC+8, Martin wrote: > > Hello, it's the first time to setup Jenkins Perforce Plugin. I just wanted > to setup a simple project to test the automatic build feature in Jenkins. > On my local machine, my project is: > > /home/martin/p4/test > > I created a workspace named jenkins_test, whose root > is /home/martin/p4/test. I can test syncing with Perforce. > > However, in Jenkins, whenever a build finishes, it changes my root > directory of my workspace from /home/martin/p4/test to > /var/lib/jenkins/jobs/.... on the Jenkins machine. This isn't the expected > behavior, right? Otherwise, I have to change the root of the workspace back > to /home/maritn/p4/test on my local machine after each build. > > In Jenkins, I created a user named "jenkins" and use that user name to > login Jenkins to start the build and do the configure. > > I have a few questions here: > 1) What' the problem here? > 2) Does the user "jenkins" on Jenkins have anything to do with the Linux > user who installed Jenkins and P4? > > Thank you for help. > > > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/981b3563-13ac-4fb2-b470-f0b2ecac76f9%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
