Class: DEIS::Validations

Inherits:
Object
  • Object
show all
Defined in:
lib/deis_deploy/validations.rb

Class Method Summary collapse

Class Method Details

.cluster(env, host) ⇒ Object



13
14
15
16
17
18
# File 'lib/deis_deploy/validations.rb', line 13

def self.cluster(env, host)
  ssh = SSH.new({:host => host, :user => nil})
  cluster = ssh.exec!("deis clusters | grep #{env} | wc -l").to_i
  ssh.close
  if cluster == 1 then true else false end
end

.configObject



4
5
6
# File 'lib/deis_deploy/validations.rb', line 4

def self.config
  DEIS::Validations.git
end

.deploy(env, host, config) ⇒ Object



8
9
10
11
# File 'lib/deis_deploy/validations.rb', line 8

def self.deploy(env, host, config)
  # make sure a cluster exists
  DEIS::Validations.cluster(env, host)
end

.gitObject



20
21
22
23
24
25
26
27
28
29
# File 'lib/deis_deploy/validations.rb', line 20

def self.git
  if ! DEIS::Git.is_git?
    "Not a git repository, exiting".fatal
    exit 1
  end
  if DEIS::Git.remote.nil?
    "Git remote could not be found, exiting".fatal
    exit 1
  end
end