Top Level Namespace

Defined Under Namespace

Modules: ErrorList, Methods Classes: Core, Errors

Instance Method Summary collapse

Instance Method Details

#check_local_db(teh_yml) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/badger/config/deploy.rb', line 13

def check_local_db(teh_yml)
  if teh_yml['local_db'] == nil or teh_yml['local_db'] == true
    puts
    puts "Worker servers cannot be deployed with a local project database."
    puts "Please use an exteral database."
    puts
    exit
  end
end

#remote_directory_empty?(full_path) ⇒ Boolean



9
10
11
# File 'lib/badger/config/deploy.rb', line 9

def remote_directory_empty?(full_path)
  'true' ==  capture('[ "$(ls -A /opt/git/)" ] && echo "false" || echo "true"').strip
end

#remote_file_exists?(full_path) ⇒ Boolean



5
6
7
# File 'lib/badger/config/deploy.rb', line 5

def remote_file_exists?(full_path)
  'true' ==  capture("if [ -d #{full_path} ]; then echo 'true'; fi").strip
end

#test_file(full_path) ⇒ Object



7
8
9
# File 'lib/badger/core/files/cap/deploy/staging-app.rb', line 7

def test_file(full_path)
  'true' == capture("if [ -f #{full_path} ]; then echo 'true'; fi").strip
end