Class: Beanstalk::Deploy

Inherits:
Thor
  • Object
show all
Defined in:
lib/beanstalk.rb

Instance Method Summary collapse

Instance Method Details

#__print_versionObject



11
12
13
# File 'lib/beanstalk.rb', line 11

def __print_version
  puts '1.1.4'
end

#deployObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/beanstalk.rb', line 24

def deploy
  app_name = options[:app_name]
  source_dir = options[:source_dir]
  profile_name = options[:profile]
  region = options[:region]
  tags = options[:tags]

  if options[:env_name].size < 40
    env_name = options[:env_name]
  else
    puts 'Environment name too long, truncating...'
    env_name = options[:env_name][0..39].gsub(/\s\w+$/,'...')
  end

  # Authenticates the user & sets up a new ElasticBeanstalk client
  authenticate_user(profile_name, region)

  # Checks if the application exists & creates a new one if it doest
  app = check_applications(app_name)

  # Check if the environment exists then creates or deploys application as appropriate
  deploy_environment(app_name, env_name, source_dir, tags)

end