Class: Travis::Cli::Deploy

Inherits:
Object
  • Object
show all
Includes:
Helper
Defined in:
lib/travis/cli/deploy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(shell, remote, options) ⇒ Deploy

Returns a new instance of Deploy.



8
9
10
11
12
# File 'lib/travis/cli/deploy.rb', line 8

def initialize(shell, remote, options)
  @remote = remote
  @options = options
  @shell = shell
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/travis/cli/deploy.rb', line 6

def options
  @options
end

#shellObject (readonly)

Returns the value of attribute shell.



6
7
8
# File 'lib/travis/cli/deploy.rb', line 6

def shell
  @shell
end

Instance Method Details

#invokeObject



14
15
16
17
18
19
20
21
22
23
# File 'lib/travis/cli/deploy.rb', line 14

def invoke
  if clean?
    tag if remote == 'production'
    configure if configure?
    push
    migrate if migrate?
  else
    error 'There are unstaged changes.'
  end
end