2011-09-25 9 views
6

मैं जेनकींस के साथ मेरी gitolite काम पाने के लिए तो मैं रेपोस सर्वर से होस्ट और जेनकींस के साथ काम कर सकते हैं दिनों के लिए कोशिश कर रहे हैं (वे पर हैं एक ही सेवर)।जेनकींस पाने के लिए कोशिश कर रहा है और सफलतापूर्वक काम करने के लिए gitolite - अनुमति अस्वीकृत (publickey, पासवर्ड)

मेरे पास गिटोलाइट काम कर रहा है लेकिन मुझे लगता है कि मुझे एसएसएच के साथ समस्या है। मुझे चैट पर कुछ मदद मिली और जेनकींस /। एसएसएच में निजी कुंजी जोड़ा गया।

मैं एक उपयोगकर्ता "Git" कि gitolite होस्ट करता है, और मैं एक उपयोगकर्ता "gitolite" और एक "जेनकींस" उपयोगकर्ता मिला है। मैं Git क्लोन [email protected] का उपयोग करके एक रेपो क्लोन कर सकते हैं: मैट्रिक्स

लेकिन मैं जेनकींस में इसका इस्तेमाल नहीं कर सकते हैं। जब मैं निर्माण करने की कोशिश करता हूं तो मुझे यह मिलता है।

Checkout:workspace//var/lib/jenkins/jobs/Matrix/workspace - 
[email protected] 
Using strategy: Default 
Checkout:workspace//var/lib/jenkins/jobs/Matrix/workspace - 
[email protected] 

Cloning the remote Git repository 
Cloning repository origin 
ERROR: Error cloning remote repo 'origin' : Could not clone [email protected]:Matrix 
ERROR: Cause: Error performing command: git clone --progress -o origin [email protected]:Matrix /var/lib/jenkins/jobs/Matrix/workspace 
Command "git clone --progress -o origin [email protected]:Matrix 
/var/lib/jenkins/jobs/Matrix/workspace" returned status code 128: Cloning into  /var/lib/jenkins/jobs/Matrix/workspace... 
Permission denied, please try again. 
Permission denied, please try again. 
Permission denied (publickey,password). 
fatal: The remote end hung up unexpectedly 

Trying next repository 
ERROR: Could not clone repository 
FATAL: Could not clone 
hudson.plugins.git.GitException: Could not clone 
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1042) 
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:968) 
at hudson.FilePath.act(FilePath.java:758) 
at hudson.FilePath.act(FilePath.java:740) 
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:968) 
at hudson.model.AbstractProject.checkout(AbstractProject.java:1193) 
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:566) 
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:454) 
at hudson.model.Run.run(Run.java:1376) 
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) 
at hudson.model.ResourceController.execute(ResourceController.java:88) 
at hudson.model.Executor.run(Executor.java:230) 

मैं अपने सर्वर और सु के लिए लॉग इन - जेनकींस, तो टाइप करें "ssh -v Git @ सर्वर" मैं इस मिलता है।

[email protected]:~$ sudo su - jenkins 
[email protected]:~$ ssh -v [email protected] 
OpenSSH_5.8p1 Debian-1ubuntu3, OpenSSL 0.9.8o 01 Jun 2010 
debug1: Reading configuration data /etc/ssh/ssh_config 
debug1: Applying options for * 
debug1: Connecting to server [127.0.1.1] port 22. 
debug1: Connection established. 
debug1: identity file /var/lib/jenkins/.ssh/id_rsa type -1 
debug1: identity file /var/lib/jenkins/.ssh/id_rsa-cert type -1 
debug1: identity file /var/lib/jenkins/.ssh/id_dsa type -1 
debug1: identity file /var/lib/jenkins/.ssh/id_dsa-cert type -1 
debug1: identity file /var/lib/jenkins/.ssh/id_ecdsa type -1 
debug1: identity file /var/lib/jenkins/.ssh/id_ecdsa-cert type -1 
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.8p1 Debian-1ubuntu3 
debug1: match: OpenSSH_5.8p1 Debian-1ubuntu3 pat OpenSSH* 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_5.8p1 Debian-1ubuntu3 
debug1: SSH2_MSG_KEXINIT sent 
debug1: SSH2_MSG_KEXINIT received 
debug1: kex: server->client aes128-ctr hmac-md5 none 
debug1: kex: client->server aes128-ctr hmac-md5 none 
debug1: sending SSH2_MSG_KEX_ECDH_INIT 
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY 
debug1: Server host key: ECDSA f3:ab:a6:55:83:98:c5:4f:85:c6:70:be:2f:40:1f:65 
debug1: Host 'server' is known and matches the ECDSA host key. 
debug1: Found key in /var/lib/jenkins/.ssh/known_hosts:3 
debug1: ssh_ecdsa_verify: signature correct 
debug1: SSH2_MSG_NEWKEYS sent 
debug1: expecting SSH2_MSG_NEWKEYS 
debug1: SSH2_MSG_NEWKEYS received 
debug1: Roaming not allowed by server 
debug1: SSH2_MSG_SERVICE_REQUEST sent 
debug1: SSH2_MSG_SERVICE_ACCEPT received 
debug1: Authentications that can continue: publickey,password 
debug1: Next authentication method: publickey 
debug1: Trying private key: /var/lib/jenkins/.ssh/id_rsa 
debug1: read PEM private key done: type RSA 
debug1: Authentications that can continue: publickey,password 
debug1: Trying private key: /var/lib/jenkins/.ssh/id_dsa 
debug1: Trying private key: /var/lib/jenkins/.ssh/id_ecdsa 
debug1: Next authentication method: password 
[email protected]'s password: 

यह अभी भी पासवर्ड के लिए पूछता ... जो कोई भी इस किया है? जेनकीट के साथ काम कर रहे गिटोलाइट प्राप्त करना? मैं किसी भी मदद के लिए बहुत आभारी हूं और इसे सेट अप करने में सहायता के लिए खुशी से 10 रुपये (वीज़ा कार्ड) दान कर सकता हूं!

+1

एसएसएच लॉग के अनुसार, आपकी निजी कुंजी 'id_rsa' सर्वर द्वारा स्वीकार नहीं की जा रही है। जांचें कि गिटोलाइट में सार्वजनिक कुंजी है जो निजी कुंजी से मेल खाती है, और उस गिटोलाइट ने उस कुंजी के साथ ~/git/.ssh/अधिकृत_keys फ़ाइल को सही तरीके से अपडेट किया है। –

+0

उत्तर के लिए धन्यवाद! मैं अभी इसमें देख रहा हूं, लेकिन मुझे यकीन नहीं है कि इससे कैसे निपटें। जेनकींस में मैं एक बिल्ड नहीं कर सकता, लेकिन मुझे यकीन नहीं है कि मुझे लगता है कि मुझे कैसा लगता है। अगर मुझे मेरी मैचबुक प्रो मिल गई है और मेरे सर्वर तक पहुंचने का प्रयास किया गया है, तो मुझे लगता है कि मैं बस ssh e-ject.se लिखूं? मुझे कौन सा लेख चाहिए? सर्वर के लिए मेरा आईमैक, सर्वर पर मेरी मैकबुक, जेनकींस? और gitolite करने के लिए? मैट्रिक्स लेकिन जेनकींस स्वीकार करते हैं और यह एक क्लोन करने के लिए मैं क्या जरूरत है: मैं एक Git उपयोगकर्ता ubuntu मैं Git क्लोन [email protected] उपयोग कर सकते हैं पर अपने मुख्य उपयोगकर्ता है कि मिल गया? जवाब के लिए बहुत आभारी और मैं दान (वीजा कार्ड अनुरोध) के अपने वादे को पूरा Joniz – Jonathan

+0

मैं इस एक से बाहर निकलें और बजाय इस गाइड बाहर की कोशिश करेंगे! http://www.nomachetejuggling.com/2011/07/31/ubuntu-tomcat-jenkins-git-ssh-togethe/ se कि कैसे जाता है की सुविधा देता है। – Jonathan

उत्तर

14

जेनकींस बॉक्स में SSH और जेनकींस उपयोगकर्ता के लिए एक SSH कुंजी युग्म बनाने (यहाँ jenkins कल्पना करते हुए):

local$ ssh jenkins-box 
[email protected]$ sudo su jenkins 
[email protected]$ ssh-keygen 
[email protected]$ cat $HOME/.ssh/id_rsa.pub 

कॉपी SSH सार्वजनिक कुंजी आप स्क्रीन पर देखते हैं और यह नई फ़ाइल keydir/jenkins.pub में पेस्ट अपने स्थानीय गिटोलाइट व्यवस्थापक भंडार के अंदर।

conf/gitolite.conf में निम्नलिखित पंक्तियां जोड़ें क्लोन और सभी खजाने को खींचने के लिए जेनकींस अनुमतियाँ देने के लिए:

repo @all 
     R  = jenkins 

लें और gitolite व्यवस्थापक भंडार धक्का। जेनकींस अब सही ढंग से काम करना चाहिए।

+0

धन्यवाद, मेरी समस्या –

+1

के लिए सही काम किया है ध्यान दें कि कुछ प्रतिष्ठानों में 'जेनकिन्स' उपयोगकर्ता लॉगिन नहीं है बल्कि सिस्टम/डेमॉन उपयोगकर्ता है। आदेशों से पहले अच्छी तरह से काम करना चाहिए (इन मामलों में मुझे मैन्युअल रूप से '/ home/jenkins' भी बनाना था) इन मामलों में 'सुडो-जे जेनकींस' चलाना)। जेनकींस के रूप में एक टेस्ट क्लोन चलाने के लिए भी सुनिश्चित करें: 'सुडो-जे जेनकिन्स क्लोन गिट @ सर्वर: रेपो ~/टेस्टक्लोन ' –

+0

मेरी पिछली टिप्पणी में सुधार:' सुडो-जे जेनकिन्स गिट क्लोन गिट @ सर्वर: रेपो ~/टेस्टक्लोन ' –

संबंधित मुद्दे