Sha256: 8192a725c9b43b894415bb6e0f9f66be06705447ebf1c07c030f83b54fe08950

Contents?: true

Size: 758 Bytes

Versions: 2

Compression:

Stored size: 758 Bytes

Contents

module Smartcloud
	class Buildpacker < Smartcloud::Base
		def initialize		
		end

		def pack
			pack_rails if File.exist? "bin/rails"
			logger.info "Could not continue ... Launch Failed."
		end

		def pack_rails
			# Remove server.pid if it exists
			FileUtils.rm("tmp/pids/server.pid") if File.exist? "tmp/pids/server.pid"

			logger.info "Performing bundle install ..."
			if system("bundle install --deployment --clean")
				logger.info "Installing Javascript Dependencies & Pre-compiling Assets ..."
				if system("bundle exec rails assets:precompile", out: File::NULL)
					logger.debug "Starting Server ..."
					if system("god -c Godfile -D")
						logger.info "Launched Application ... Success."
					end
					# exit 0
				end
			end
		end
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
smartcloud-0.0.161 lib/smartcloud/buildpacker.rb
smartcloud-0.0.160 lib/smartcloud/buildpacker.rb