module Buildable

Constants

BUILD_DIR
BUILD_ROOT_DIR
PACKAGE_DIR

Public Instance Methods

build() click to toggle source
# File lib/buildable.rb, line 23
def build
  STDOUT.sync = true
  check_configs
  Recipe[:create_path]
  Recipe[:copy_source]
  Recipe[:vendor_gems]
  Recipe[:make_init_script] unless ARGV.include?('--no-init')
  Recipe[:make_package]
  Recipe[:remove_path]
end
build_app_dir() click to toggle source
# File lib/buildable.rb, line 34
def build_app_dir
  File.join(BUILD_ROOT_DIR, Buildable.config.root_dir)
end
check_configs() click to toggle source
# File lib/buildable.rb, line 46
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
dependencies() click to toggle source

Return array with all dependencies specified in .buildable.yml

# File lib/buildable.rb, line 67
def dependencies
  self.config.depends || []
end
files_to_pack() click to toggle source
# File lib/buildable.rb, line 52
def files_to_pack
  files_to_ignore = self.config.files_to_ignore + %w{. .. .build .buildable.yml vendor}
  Dir.entries('.') - files_to_ignore
end
foreman_templates() click to toggle source
# File lib/buildable.rb, line 57
def foreman_templates
  File.expand_path('../../templates/foreman', __FILE__)
end
init() click to toggle source
# File lib/buildable.rb, line 19
def init
  Recipe[:init]
end
initd_folder() click to toggle source
# File lib/buildable.rb, line 42
def initd_folder
  File.join(BUILD_ROOT_DIR, 'etc/init.d')
end
package_name() click to toggle source

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

# File lib/buildable.rb, line 62
def package_name
  [self.config.organization, self.config.project_name].compact.collect(&:underscore).join('-')
end
upstart_folder() click to toggle source
# File lib/buildable.rb, line 38
def upstart_folder
  File.join(BUILD_ROOT_DIR, 'etc/init')
end