twingly / capistrano-twingly

:bookmark_tabs: Capistrano tasks used at Twingly

Home Page:https://rubygems.org/gems/capistrano-twingly

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bundler binstubs can reference old removed app releases which breaks the deploy

roback opened this issue · comments

Discovered in https://github.com/twingly/systemutil/issues/223

A deploy failed because the forman binstub, which we use when generating the systemd scripts, was referencing the path of an old release.

sudo fetch(:chruby_exec), "#{fetch(:chruby_ruby)} -- #{fetch(:bundle_binstubs)}/foreman export systemd /etc/systemd/system -a #{fetch(:application)} -u \`whoami\` -l #{shared_path}/log"

There's an issue related to this at capistrano/bundler#111

We could fix this by, either just add set :bundle_check_before_install, false, which will bypass this check in capistrano-bundler. This will cause bundler to generate binstubs on each deploy, and also has the side-effect of running bundle install on each deploy, which takes ~1 second instead of the faster bundle check.

Another fix would be to make our own custom task which regenerates the binstubs using bundle binstubs on each deploy.