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)


77
78
79
80
81
# File 'lib/dkdeploy/constants.rb', line 77

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)


35
36
37
# File 'lib/dkdeploy/constants.rb', line 35

def application
  fetch(:application)
end

#assets_pathString

Assets path

Returns:

  • (String)


42
43
44
# File 'lib/dkdeploy/constants.rb', line 42

def assets_path
  File.join shared_path, 'assets'
end

#copy_excludeArray

Copy exclude pattern

Returns:

  • (Array)


28
29
30
# File 'lib/dkdeploy/constants.rb', line 28

def copy_exclude
  fetch :copy_exclude, []
end

#copy_sourceString

Copy source path

Returns:

  • (String)


14
15
16
# File 'lib/dkdeploy/constants.rb', line 14

def copy_source
  fetch :copy_source, '.'
end

#datetime_formatString

Default timestamp format for database dump files

Returns:

  • (String)


63
64
65
# File 'lib/dkdeploy/constants.rb', line 63

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)


70
71
72
# File 'lib/dkdeploy/constants.rb', line 70

def default_ignore_tables
  %w[]
end

#ignore_tablesString

List of table names to be ignored when dumping from database

Returns:

  • (String)


86
87
88
# File 'lib/dkdeploy/constants.rb', line 86

def ignore_tables
  default_ignore_tables | additional_ignore_tables
end

#local_database_config_pathString

File path to local database config file

Returns:

  • (String)


56
57
58
# File 'lib/dkdeploy/constants.rb', line 56

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

#local_dump_pathString

Local Dump Path

Returns:

  • (String)


21
22
23
# File 'lib/dkdeploy/constants.rb', line 21

def local_dump_path
  fetch :local_dump_path, 'temp'
end

#remote_database_config_pathString

File path to remote database config file

Returns:

  • (String)


49
50
51
# File 'lib/dkdeploy/constants.rb', line 49

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