svn checkout not working via phing

巧了我就是萌 提交于 2019-12-08 05:47:52

问题


I'm currently trying to write an internal application to be able to deploy our projects to acceptance and production servers with a single click. We are using phing to accomplish this.

At the moment I'm having difficulty checking out (or doing an svn export) the project. I use the following command:

<exec command="svn checkout ${svn.host} ${svn.exportdir} --force --username server --password <password>"  />

on a normal command line this works perfectly, however i get prompted to accept a certificate because the host uses https. Problem is there seems to be no parameter to automatically accept a certificate.

the --trust-server-cert doesn't help either, becase the certificate is rejected due to a hostname mismatch, where the parameter only bypasses a "CA is unknown"-error.

Any ideas on how I can check out (or export, update, ...) the project?


回答1:


Do a wget on the svn servers HTTPS adress and accept the certificate permanently.

$ wget https://svn.mydomain.com/repos

And then press p to accept the cert.


I also added some hints to the PHP documentation about the problems with certificates:

Simply call

svn checkout https://svn.mydomain.com/repos --force --username server --password iMPs+nana0kIF

on your command line and accept the cert.


There could be still a problem when the user which executes the Phing command is not root, then you have to execute this command as the user which runs the Phing command:

su wwwrun wget https://... 
su wwwrun svn checkout https://...



回答2:


Just do one manual checkout as the user that will be running phing. You can checkout to /dev/null if you want to. Once you have accepted the certificate, it will stay accepted (if that user has a .subversion directory to store it).

By the way, any specific reason why you are using the svn commandline interface through and ExecTask instead of just using the SvnCheckoutTask directly?



来源:https://stackoverflow.com/questions/6651088/svn-checkout-not-working-via-phing

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!