Class: Travis::Deploy

Inherits:
Thor
  • Object
show all
Defined in:
lib/travis/deploy.rb,
lib/travis/deploy/config.rb,
lib/travis/deploy/deploy.rb,
lib/travis/deploy/helper.rb,
lib/travis/deploy/secure_key.rb

Defined Under Namespace

Modules: Helper Classes: Config, Deploy, SecureKey

Instance Method Summary collapse

Instance Method Details

#config(remote) ⇒ Object



21
22
23
# File 'lib/travis/deploy.rb', line 21

def config(remote)
  Config.new(shell, remote, options).invoke
end

#deploy(remote) ⇒ Object



29
30
31
# File 'lib/travis/deploy.rb', line 29

def deploy(remote)
  Deploy.new(shell, remote, options).invoke
end

#encrypt(slug, secret) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/travis/deploy.rb', line 36

def encrypt(slug, secret)
  puts "\nAbout to encrypt '#{secret}' for '#{slug}'\n\n"

  encrypted = nil
  begin
    encrypted = SecureKey.new(slug, options[:host]).encrypt(secret)
  rescue SecureKey::FetchKeyError
    abort 'There was an error while fetching public key, please check if you entered correct slug'
  end

  puts "Please add the following to your .travis.yml file:"
  puts ""
  puts "  secure: \"#{Base64.encode64(encrypted).strip.gsub("\n", "\\n")}\""
  puts ""
end