# Write the SSH-KEY to the disk
fs.writeFile "/cgrepos/.ssh/#{repo.id}.pub", repo.public_key, (err) ->
throw err if err
fs.writeFile "/cgrepos/.ssh/#{repo.id}", repo.private_key, (err) ->
throw err if err
exec "chmod 400 /cgrepos/.ssh/#{repo.id} && eval `ssh-agent -s` && ssh-add /cgrepos/.ssh/#{repo.id}", (error) ->
throw error if error
# First, delete the git repo on the hard drive, if it exists
exec "rm -rf #{git_location}", options, (error) ->
throw error if error
# Second, clone the repo into the location
console.log "Cloning repo #{repo.id}: #{repo.repo_name} into #{git_location}. This could take a minute"
exec "git clone #{repo.url} #{git_location}", options, (error) ->
throw error if error
में ssh-कुंजी जोड़कर क्लोन git नहीं कर सकते मैं (उन है कि कमाल के हैं के लिए coffee
का प्रयोग करके) कोशिश कर रहा हूँ कि नोड में। लेकिन किसी कारण से, जब यह चलता है, तो यह मुझे एक त्रुटि देता है: Error: Command failed: conq: repository access denied. deployment key is not associated with the requested repository.
Node.js
सुनिश्चित नहीं है कि मैं क्या गलत कर रहा हूं। अगर मैं कमांड लाइन से उन आदेशों को सीधे चलाता हूं, तो सबकुछ ठीक काम करता प्रतीत होता है। कोई विचार?
आप 'ssh' के साथ सीधे इस प्रजनन, समीकरण से Git लेने की कोशिश की है? यद्यपि आप बिटबकेट के सर्वर से कुछ भी उपयोगी नहीं होने की संभावना नहीं है (त्रुटि संदेश से मुझे लगता है कि आप इसका उपयोग कर रहे हैं) आपको देखना चाहिए "आप बिटबकेट से कनेक्ट करने के लिए गिट या एचजी का उपयोग कर सकते हैं। शैल एक्सेस अक्षम है।" अगर यह काम करता है; यदि आप काम नहीं करते हैं तो आप डीबग करने के लिए 'ssh -v' आज़मा सकते हैं। –
एक और चीज जिसे आप कोशिश कर सकते हैं वह एक रैपर शेल स्क्रिप्ट बनाना है जो 'exec ssh -v" $ @ "चलाता है और 'GIT_SSH' पर्यावरण चर सेट करता है ताकि गिट वर्बोज मोड में एसएसएच चलाए। फिर आप देख सकते हैं कि 'git' एसएसएच कैसे चला रहा है और यह आपको कुछ सुराग दे सकता है। –