Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def push_github()
- Thread.start do
- @repo = Rugged::Repository.new('/path/to/dir')
- logger.info 'Pushing submodule...'
- remote = @repo.remotes["origin"]
- # callback_called = false
- # update_tips_cb = proc { callback_called = true }
- # credentials = Rugged::Credentials::SshKey.new({
- # username: ENV["GIT_SSH_USER"],
- # publickey: ENV["GIT_SSH_PUBKEY"],
- # privatekey: ENV["GIT_SSH_KEY"],
- # passphrase: ENV["GIT_SSH_PASSPHASE"],
- # })
- # credentials = ssh_key_credential()
- # credentials = Rugged::Credentials::UserPassword.new({username: ENV['USER'], password: ENV['PASS']})
- # credentials = Rugged::Credentials::UserPassword.new({
- # username: ENV['GITHUB_USER'],
- # password: ENV['GITHUB_PASSWORD']
- # })
- remote.push(['refs/heads/master'], {credentials: credentials, update_tips: update_tips_cb})
- logger.info 'Done'
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement