Kunstmaan / kStrano

kStrano (KumaStrano) is a Capistrano deployment “recipe” for Kunstmaan specific applications to make our job of deploying a lot easier. It integrates with Airbrake, Jenkins and Campfire.
MIT License
13 stars 0 forks source link

kStrano assumes Capfile already matches new format if it exists #34

Closed SpoBo closed 11 years ago

SpoBo commented 11 years ago
[14:35:43][vincent@Zoidberg .../someproject/data/current](master $%)$ kumafy .
[skip] ./Capfile already exists
/Users/vincent/.rvm/gems/ruby-1.9.3-p385/gems/kstrano-1.1.2/bin/kumafy:42:in `update_capfile': undefined method `[]' for nil:NilClass (NoMethodError)
    from /Users/vincent/.rvm/gems/ruby-1.9.3-p385/gems/kstrano-1.1.2/bin/kumafy:296:in `<top (required)>'
    from /Users/vincent/.rvm/gems/ruby-1.9.3-p385/bin/kumafy:19:in `load'
    from /Users/vincent/.rvm/gems/ruby-1.9.3-p385/bin/kumafy:19:in `<main>'
    from /Users/vincent/.rvm/gems/ruby-1.9.3-p385/bin/ruby_noexec_wrapper:14:in `eval'
    from /Users/vincent/.rvm/gems/ruby-1.9.3-p385/bin/ruby_noexec_wrapper:14:in `<main>'

This is not the case. Capfile contents:

load 'deploy' if respond_to?(:namespace) # cap2 differentiator

require 'capifony_symfony2'
load Gem.find_files('kstrano.rb').last.to_s
load 'app/config/deploy'

https://github.com/Kunstmaan/kStrano/blob/master/bin/kumafy#L42 Old capfile has 'capifony#{recipe}'. Recipe check checks for kstrano#{recipe}.

Should I just do kumafy . --force? seems overkill. For now I just changed capifony to kstrano in Capfile.

daanporon commented 11 years ago

I think you should use the --force option else the Capfile won't be updated and you have an old Capfile. --force will delete the Capfile and regenerate it. Unfortunately there is still a bug, which will always overwrite your deploy.rb file ... but if you specify the right parameters when asked for it it's no problem. For all the other files he will still ask if he should update the file or not.

It should be fixed that he also asks if the deploy.rb file should be overwritten or not.