0

We created a clone from the dev server for the jenkis CI to improve our work, we configurated it and the tests started working as we wanted. Then we find out that the git plugin in the jenkins is not liked with the project's workspace. It's a PHP REST api project, every server has it's own configuration. So we gave to the jenkins the path of the project to use that - this is the "Checkout to a sub-directiory" option. Then when a new PR is created, then jenkins is tiggered and it's start the build, and at first it's trying to delete the complete workspace. I wouldn't think that it would be impossible to run tests on an already existing project with the jenkins, but this is ablosutly not the way how to do it. Every server has it's own configurations, so those are not part of the git repo, plus there is a base installation for the framework, and that's also not part of the git repository.

Now my question is what information are we missing, and how could we configure the git pluggin to make the jenkins start working on our existing project?

Random Dude
  • 872
  • 1
  • 9
  • 24

1 Answers1

0

Ensure that you have the GitHub plugin and Git Pull Request Plugin installed in your jenkins workspace, now all you have check these 2 option

enter image description here

Also note that you have to add your public in Git which you would have done I'm guessing, now a hook will be created and you can send a request from Git and if you have a green tick ALL GOOD, else you have to debug it try this link Github webhook URL config issue? How to fix it?

rohit thomas
  • 2,302
  • 11
  • 23
  • oh gosh I think my description wasnt truely clear, sorry. So I wanna run the test using the codeception. The trigger is working I'm using the Git Pull Request Plugin, and every time I create a new PR or a commit in a PR the Jenkins start the build. But the problem is that I dont know how to tell the git that checkout to the folder where the REST API already works. I found a "checkout to a sub-directory" and a default workspace option, but both of them wanna delete the entire folder, with the configuration and everything. And I dont know why cant I just checkout there and run the tests then. – Random Dude May 04 '18 at 09:44
  • so it will delete the data in that folder (per job per checkout) explained here https://stackoverflow.com/questions/9767919/in-jenkins-how-to-checkout-a-project-into-a-specific-directory-using-git .....if you don't mind using Pipeline Projects then it's quite easy try this https://stackoverflow.com/questions/36288723/jenkinfile-dsl-how-to-specify-target-directory/36436017 – rohit thomas May 04 '18 at 11:04
  • it was a permission problem on the server, thanks for the help – Random Dude May 07 '18 at 23:01