Module: Deploy::Checks

Includes:
Utility
Included in:
Runner
Defined in:
lib/deploy/checks.rb

Instance Method Summary collapse

Methods included from Utility

#command?

Instance Method Details

#check_rollback_version(version, environment) ⇒ Object



15
16
17
18
# File 'lib/deploy/checks.rb', line 15

def check_rollback_version(version, environment)
  check_version(version, environment)
  (shout('You can only rollback to a previous version'); exit(1)) unless application_versions_array.include?(version)
end

#check_setupObject



7
8
9
10
11
12
13
# File 'lib/deploy/checks.rb', line 7

def check_setup
  (shout('docker not installed'); exit(1)) unless command?('docker')
  (shout('eb command not installed'); exit(1)) unless command?('eb')
  (shout('elasticbeanstalk not configured for this project. run "eb init".'); exit(1)) unless File.exist?('.elasticbeanstalk')
  (shout('AWS credentials not configured.'); exit(1)) unless ENV['AWS_ACCESS_KEY_ID'] && ENV['AWS_SECRET_ACCESS_KEY'] && ENV['AWS_REGION']
  (shout('ENV DOCKER_REPO not set'); exit(1)) unless ENV['DOCKER_REPO']
end

#check_version(version, environment) ⇒ Object



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

def check_version(version, environment)
  (shout('You must pass a version with -v'); exit(1)) unless version
  (shout('You are currently on that version'); exit(1)) if current_version_for_environment(environment) == version
end