Module: Buildable

Includes:
Configureasy
Defined in:
lib/buildable.rb,
lib/buildable/version.rb

Defined Under Namespace

Modules: FileMaker, RakeTask, Recipe, Shell

Constant Summary collapse

BUILD_DIR =
'./.build'
BUILD_ROOT_DIR =
'./.build/root'
PACKAGE_DIR =
'./pkg'
VERSION =
"2.1.2"

Class Method Summary collapse

Class Method Details

.buildObject



24
25
26
27
28
29
30
31
32
33
# File 'lib/buildable.rb', line 24

def build
  STDOUT.sync = true
  check_configs
  Recipe[:create_path]
  Recipe[:copy_source]
  Recipe[:vendor_gems]
  Recipe[:make_init_script]
  Recipe[:make_package]
  Recipe[:remove_path]
end

.build_app_dirObject



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

def build_app_dir
  File.join(BUILD_ROOT_DIR, Buildable.config.root_dir)
end

.check_configsObject



47
48
49
50
51
# File 'lib/buildable.rb', line 47

def check_configs
  return if File.exist?('.buildable.yml') && File.exist?('production.env') && File.exist?('Procfile')
  puts "Missing config please run buildable init to create it."
  exit 1
end

.files_to_packObject



53
54
55
56
# File 'lib/buildable.rb', line 53

def files_to_pack
  files_to_ignore = self.config.files_to_ignore + %w{. .. .build .buildable.yml vendor}
  Dir.entries('.') - files_to_ignore
end

.foreman_templatesObject



58
59
60
# File 'lib/buildable.rb', line 58

def foreman_templates
  File.expand_path('../../templates/foreman', __FILE__)
end

.initObject



20
21
22
# File 'lib/buildable.rb', line 20

def init
  Recipe[:init]
end

.initd_folderObject



43
44
45
# File 'lib/buildable.rb', line 43

def initd_folder
  File.join(BUILD_ROOT_DIR, 'etc/init.d')
end

.package_nameObject

Make package name using Organization name (when available) with project name



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

def package_name
  [config.organization, config.project_name].compact.collect(&:underscore).join('-')
end

.upstart_folderObject



39
40
41
# File 'lib/buildable.rb', line 39

def upstart_folder
  File.join(BUILD_ROOT_DIR, 'etc/init')
end