Skip to content

Commit

Permalink
Don't restart the app when updating the config. Heroku will do this f…
Browse files Browse the repository at this point in the history
…or us
  • Loading branch information
dhiemstra committed Dec 18, 2011
1 parent d590c90 commit f625dc3
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 24 deletions.
1 change: 0 additions & 1 deletion lib/travis/cli.rb
Expand Up @@ -13,7 +13,6 @@ class Cli < Thor
namespace 'travis'

desc 'config', 'Sync config between keychain, app and local working directory'
method_option :restart, :aliases => '-r', :type => :boolean, :default => true
method_option :backup, :aliases => '-b', :type => :boolean, :default => false

def config(remote)
Expand Down
10 changes: 0 additions & 10 deletions lib/travis/cli/config.rb
Expand Up @@ -17,7 +17,6 @@ def initialize(shell, remote, options)
def invoke
store
push
restart if restart?
end

protected
Expand Down Expand Up @@ -49,20 +48,11 @@ def push
run "heroku config:add travis_config=#{config} -r #{remote}", :echo => "heroku config:add travis_config=... -r #{app}"
end

def restart
say 'Restarting the app ...'
run "heroku restart -r #{remote}"
end

def backup
say 'Backing up the old config file ...'
run "cp #{filename} #{filename}.backup"
end

def restart?
!!options['restart']
end

def backup?
!!options['backup']
end
Expand Down
2 changes: 1 addition & 1 deletion lib/travis/cli/deploy.rb
Expand Up @@ -67,7 +67,7 @@ def configure?
end

def configure
Config.new(shell, remote, :restart => false).invoke
Config.new(shell, remote, {}).invoke
end

def migrate?
Expand Down
12 changes: 0 additions & 12 deletions spec/travis/cli/config_spec.rb
Expand Up @@ -29,17 +29,5 @@
command.expects(:run).with { |cmd, options| cmd =~ /heroku config:add travis_config=.* -r staging/m }
command.invoke
end

it 'restarts the app when --restart is given' do
command = Travis::Cli::Config.new(shell, 'staging', 'restart' => true)
command.expects(:restart)
command.invoke
end

it 'does not restart the app when --restart is not given' do
command = Travis::Cli::Config.new(shell, 'staging', {})
command.expects(:restart).never
command.invoke
end
end
end

0 comments on commit f625dc3

Please sign in to comment.