Module: Dkdeploy::Constants

Defined in:
lib/dkdeploy/constants.rb

Overview

Global static methods

Instance Method Summary collapse

Instance Method Details

#additional_ignore_tablesArray

List of table names to be ignored when dumping from database defined via Capistrano variable or environment variable

Returns:

  • (Array)


75
76
77
78
79
# File 'lib/dkdeploy/constants.rb', line 75

def additional_ignore_tables
  env_array_list = ENV.fetch('ADDITIONAL_IGNORE_TABLES', '').split ' '
  cap_array_list = fetch(:additional_ignore_tables, [])
  env_array_list | cap_array_list
end

#applicationString

Application name

Returns:

  • (String)


33
34
35
# File 'lib/dkdeploy/constants.rb', line 33

def application
  fetch(:application)
end

#assets_pathString

Assets path

Returns:

  • (String)


40
41
42
# File 'lib/dkdeploy/constants.rb', line 40

def assets_path
  File.join shared_path, 'assets'
end

#copy_excludeArray

Copy exclude pattern

Returns:

  • (Array)


26
27
28
# File 'lib/dkdeploy/constants.rb', line 26

def copy_exclude
  fetch :copy_exclude, []
end

#copy_sourceString

Copy source path

Returns:

  • (String)


12
13
14
# File 'lib/dkdeploy/constants.rb', line 12

def copy_source
  fetch :copy_source, '.'
end

#datetime_formatString

Default timestamp format for database dump files

Returns:

  • (String)


61
62
63
# File 'lib/dkdeploy/constants.rb', line 61

def datetime_format
  '%Y-%m-%d_%H-%M'
end

#default_ignore_tablesString

List of table names to be ignored by default when dumping from database

Returns:

  • (String)


68
69
70
# File 'lib/dkdeploy/constants.rb', line 68

def default_ignore_tables
  %w[]
end

#ignore_tablesString

List of table names to be ignored when dumping from database

Returns:

  • (String)


84
85
86
# File 'lib/dkdeploy/constants.rb', line 84

def ignore_tables
  default_ignore_tables | additional_ignore_tables
end

#local_database_config_pathString

File path to local database config file

Returns:

  • (String)


54
55
56
# File 'lib/dkdeploy/constants.rb', line 54

def local_database_config_path
  File.join 'temp', "db_settings.#{fetch(:stage)}.yaml"
end

#local_dump_pathString

Local Dump Path

Returns:

  • (String)


19
20
21
# File 'lib/dkdeploy/constants.rb', line 19

def local_dump_path
  fetch :local_dump_path, 'temp'
end

#remote_database_config_pathString

File path to remote database config file

Returns:

  • (String)


47
48
49
# File 'lib/dkdeploy/constants.rb', line 47

def remote_database_config_path
  File.join shared_path, 'config', "db_settings.#{fetch(:stage)}.yaml"
end