Advertisement
Guest User

Untitled

a guest
Jan 28th, 2016
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. def push_github()
  2. Thread.start do
  3. @repo = Rugged::Repository.new('/path/to/dir')
  4.  
  5. logger.info 'Pushing submodule...'
  6. remote = @repo.remotes["origin"]
  7.  
  8. # callback_called = false
  9. # update_tips_cb = proc { callback_called = true }
  10. # credentials = Rugged::Credentials::SshKey.new({
  11. # username: ENV["GIT_SSH_USER"],
  12. # publickey: ENV["GIT_SSH_PUBKEY"],
  13. # privatekey: ENV["GIT_SSH_KEY"],
  14. # passphrase: ENV["GIT_SSH_PASSPHASE"],
  15. # })
  16. # credentials = ssh_key_credential()
  17. # credentials = Rugged::Credentials::UserPassword.new({username: ENV['USER'], password: ENV['PASS']})
  18. # credentials = Rugged::Credentials::UserPassword.new({
  19. # username: ENV['GITHUB_USER'],
  20. # password: ENV['GITHUB_PASSWORD']
  21. # })
  22.  
  23. remote.push(['refs/heads/master'], {credentials: credentials, update_tips: update_tips_cb})
  24. logger.info 'Done'
  25. end
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement