twingly / capistrano-twingly

:bookmark_tabs: Capistrano tasks used at Twingly
https://rubygems.org/gems/capistrano-twingly
MIT License
2 stars 0 forks source link

Cannot published gem using "rake release" #48

Closed roback closed 5 years ago

roback commented 5 years ago

Since we started using 2FA for RubyGems we can't publish gems using bundle exec rake release. Rake gets stuck on the release:rubygem_push task, as shown when running with --trace:

$ bundle exec rake release --trace
** Invoke release (first_time)
** Invoke build (first_time)
** Execute build
capistrano-twingly 4.0.0 built to pkg/capistrano-twingly-4.0.0.gem.
** Invoke release:guard_clean (first_time)
** Execute release:guard_clean
** Invoke release:source_control_push (first_time)
** Execute release:source_control_push
Tag v4.0.0 has already been created.
** Invoke release:rubygem_push (first_time)
** Execute release:rubygem_push

Running gem push manually shows exactly what's happening:

$ gem push pkg/capistrano-twingly-4.0.0.gem
Pushing gem to https://rubygems.org...
You have enabled multi-factor authentication. Please enter OTP code.
Code:

After entering the 2FA/OTP code, the gem gets published successfully.

dentarg commented 5 years ago

Here's the upstream issue for this: https://github.com/bundler/bundler/issues/6854

dentarg commented 5 years ago

Here's the upstream issue for this: bundler/bundler#6854

And they have two outstanding PRs for it:

dentarg commented 5 years ago

Progress is being made, bundler/bundler#6854 was closed upstream by https://github.com/bundler/bundler/pull/7199 :)

dentarg commented 5 years ago

Looks like the fix will be in Bundler v2.1 (https://github.com/twingly/twingly-url/issues/139#issuecomment-525646492). I've also changed our Rubygems settings to not require OTP code on gem push.