设置 Jenkins 和权限问题

设置 Jenkins 和权限问题

我已经在 Mac Lion 上设置了 Jenkins,但是我遇到了很多问题。我可以连接并下载 SVN 文件存储库,但是作为 shell 构建脚本的一部分,我必须执行 SVN 更新。当我这样做时,我收到权限错误,我可以在输出中看到它要么需要 Sudo,要么在接受证书时遇到问题(即使它之前能够顺利下载存储库)

实现此目标的最佳做法有哪些?我在下面附上了我的 bash 文件的摘录

谢谢

 #!/bin/sh -x 

     # Change to our working directory 
    cd ${WORKSPACE}

    rm -fR profiles
    rm -fR sites

    cp /Users/jinni/Sites/mybuildfile.make ${WORKSPACE}

    #lets now set up the site
    drush make mybuildfile.make

svn update #this causes problems see out put below

输出:

/var/folders/zz/zyxvpxvq6csfxvn_n0000004000001/T/hudson392681277070654613.sh: line 20: drush: command not found
+ svn update
svn: warning: Can't open file '/var/root/.subversion/servers': Permission denied

Error validating server certificate for 'https://secretsite:4443':
 - The certificate is not issued by a trusted authority. Use the
   fingerprint to validate the certificate manually!
Certificate information:
 - Hostname: secretsite
 - Valid: from Mon, 14 Jun 2010 19:45:39 GMT until Thu, 13 Jun 2013 19:45:39 GMT
 - Issuer: Blah Blah
 - Fingerprint: Fingerprint Blah Blah
(R)eject, accept (t)emporarily or accept (p)ermanently? svn: OPTIONS of 'https://mysvnusername@secretsite:4443/svn/CCN/trunk/drupal': Server certificate verification failed: issuer is not trusted (https://secretsite:4443)

答案1

首次连接到远程服务器时,您需要接受证书的指纹。一个简单的方法是,以 Jenkins 运行的用户身份运行命令并点击“接受”指纹。您也可以自行管理.ssh/known_hosts

相关内容