<div dir="ltr"><div>I've done that, but Buildbot is giving me the following error:<br><br> git fetch -t git@bitbucket.org:myproject/myproject.git branch1<br> in dir /usr/local/myproject/src/buildbot/worker/myproject_runtests/build (timeout 1200 secs)<br> watching logfiles {}<br> argv: ['git', 'fetch', '-t', 'git@bitbucket.org:myproject/myproject.git', 'branch1']<br> environment:<br> HOME=/home/ubuntu<br> LANG=en_US.UTF-8<br> LOGNAME=buildbot<br> MAIL=/var/mail/buildbot<br> OLDPWD=/home/ubuntu<br> PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin<br> PWD=/usr/local/myproject/src/buildbot/worker/myproject_runtests/build<br> SHELL=/bin/bash<br> SHLVL=1<br> SUDO_COMMAND=/bin/bash -c cd /usr/local/myproject/src/buildbot; /usr/local/myproject/.env/bin/buildbot-worker restart worker<br> SUDO_GID=1000<br> SUDO_UID=1000<br> SUDO_USER=ubuntu<br> TERM=vt100<br> USER=buildbot<br> USERNAME=buildbot<br> _=/usr/local/myproject/.env/bin/buildbot-worker<br> using PTY: False<br> Host key verification failed.<br> fatal: Could not read from remote repository.<br><br></div>Presumably, the problem is that Buildbot is using /home/ubuntu for HOME instead of /var/lib/buildbot. However, Buildbot is running as the buildbot user, so I'm unsure why it would be using the ubuntu user's home directory. How do I fix this?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 13, 2017 at 11:41 AM, Bob Drummond <span dir="ltr"><<a href="mailto:bob.drummond@netronome.com" target="_blank">bob.drummond@netronome.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>Assuming <span style="font-family:sans-serif">/var/lib/buildbot is the home directory of your buildbot worker/slave user, yes, that's all you should have to do. If you can log in interactively as the buildbot user and SSH without a password, you should be set. I've found the "ssh -v" flag is useful in debugging what key is actually being used.</span><br><br><div data-smartmail="gmail_signature">Bob Drummond<br>Software Engineer<br><br><br>Netronome | 3159 Unionville Road, Suite 100 Cranberry Twp., PA 16066<br><br>Phone: <a href="tel:(724)%20778-3295" value="+17247783295" target="_blank">+1 (724) 778-3295</a> | <a href="http://www.netronome.com" target="_blank">www.netronome.com</a></div><div><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mar 13, 2017 11:08, "Chris Spencer" <<a href="mailto:chrisspen@gmail.com" target="_blank">chrisspen@gmail.com</a>> wrote:<br type="attribution"><blockquote class="m_-7298592481193562576quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>My preference would be to use SSH keys. However, since there's no official documentation explaining how to use them with Buildbot, and these replies have mentioned a lot of caveats, I was acting as though SSH keys are officially not supported.<br><br></div>I posted this question to SO over a year ago, and the only reply I received was essentially "just use a username and password".<br><br></div><div>How do I configure Buildbot to use SSH keys? I only have a single slave running on the same server as master, so can I simply upload my custom SSH key to /var/lib/buildbot/.ssh/mykey.p<wbr>em or do I need to update something in my tac or cfg files?<br></div></div><div class="m_-7298592481193562576elided-text"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 6, 2017 at 2:47 PM, Pierre Tardy <span dir="ltr"><<a href="mailto:tardyp@gmail.com" target="_blank">tardyp@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">It is not implemented because people are supposed to use SSH keys. Is there a reason why you can't use SSH keys ?</p>
<p dir="ltr">Buildbot has capabilities to redact password from commands. It's used I think in svn<br>
</p><div class="m_-7298592481193562576m_-2818269083958457081HOEnZb"><div class="m_-7298592481193562576m_-2818269083958457081h5">
<br><div class="gmail_quote"><div dir="ltr">Le lun. 6 mars 2017 20:32, Chris Spencer <<a href="mailto:chrisspen@gmail.com" target="_blank">chrisspen@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg">Is there any way to suppress the output of the Git step (<a href="http://docs.buildbot.net/latest/manual/cfg-buildsteps.html#step-Git" class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg" target="_blank">http://docs.buildbot.net/late<wbr>st/manual/cfg-buildsteps.html#<wbr>step-Git</a>), so my password isn't visible in the logs? It doesn't appear to accept any type of "gitbin" option.<br class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg"></div><div class="gmail_extra m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg"><br class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg"><div class="gmail_quote m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg">On Thu, Mar 2, 2017 at 6:42 PM, Will Rosecrans <span dir="ltr" class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg"><<a href="mailto:wrosecrans@gmail.com" class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg" target="_blank">wrosecrans@gmail.com</a>></span> wrote:<br class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg"><blockquote class="gmail_quote m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg">As far as I know, the GitPoller doesn't directly support that. I have mostly used salt to set up the buildslave machine, and included ssh and git config as part of the buildslave's system config rather than the buildbot config. If you are using GitHub, it's also easy to set up token passwords on an account and use that for service work. It uses a password rather than an actual key, but the password is a long string of gibberish, and you can use the token as a sub account, with different permissions for the tokens and the ability tp revoke them individually.<div class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg"><br class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg"></div><div class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg">You can also set the GitPoller's gitbin to point to a script that runs git with whatever key setup you like, and have buildbot just invoke that script.</div></div></blockquote></div></div><div class="gmail_extra m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg"><div class="gmail_quote m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg"><blockquote class="gmail_quote m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg"><br class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg"><div class="gmail_quote m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg"><span class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg">On Wed, Mar 1, 2017 at 5:18 PM, Chris Spencer <span dir="ltr" class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg"><<a href="mailto:chrisspen@gmail.com" class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg" target="_blank">chrisspen@gmail.com</a>></span> wrote:<br class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg"></span><blockquote class="gmail_quote m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg"><div dir="ltr" class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg"><div class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg">How do you specify the ssh key to use with the Gitpoller and Git step classes?<br class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg"><br class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg"></div>I'm currently hard-coding my username/password in the repourl, and I'd like to move away from that for security reasons. However, even after reading the docs and looking at the source, I can see no obvious way to specify the pem key file to checkout and fetch via ssh.<br class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg"></div>
<br class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg"></span><span class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg">______________________________<wbr>_________________<br class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg">
users mailing list<br class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg">
<a href="mailto:users@buildbot.net" class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg" target="_blank">users@buildbot.net</a><br class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg">
<a href="https://lists.buildbot.net/mailman/listinfo/users" rel="noreferrer" class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg" target="_blank">https://lists.buildbot.net/mai<wbr>lman/listinfo/users</a><br class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg"></span></blockquote></div><br class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg"></div>
</blockquote></div></div>
______________________________<wbr>_________________<br class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg">
users mailing list<br class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg">
<a href="mailto:users@buildbot.net" class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg" target="_blank">users@buildbot.net</a><br class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg">
<a href="https://lists.buildbot.net/mailman/listinfo/users" rel="noreferrer" class="m_-7298592481193562576m_-2818269083958457081m_-5789764041128712557gmail_msg" target="_blank">https://lists.buildbot.net/mai<wbr>lman/listinfo/users</a></blockquote></div>
</div></div></blockquote></div><br></div>
</div><br>______________________________<wbr>_________________<br>
users mailing list<br>
<a href="mailto:users@buildbot.net" target="_blank">users@buildbot.net</a><br>
<a href="https://lists.buildbot.net/mailman/listinfo/users" rel="noreferrer" target="_blank">https://lists.buildbot.net/mai<wbr>lman/listinfo/users</a><br></blockquote></div><br></div></div></div></div></div>
</blockquote></div><br></div>