Sha256: 393cabfb1feac215b97ee5a928a750f5e32cb381bfa9ff1ebd46a520b083a519

Contents?: true

Size: 806 Bytes

Versions: 3

Compression:

Stored size: 806 Bytes

Contents

class Buildpacker
	def initialize		
	end
	
	def pack
		puts "---------------------------------------------------------------------------"
		
		pack_rails if File.exist? "bin/rails"

		puts "-----> 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"

		puts "-----> Performing bundle install ... "
		if system("bundle install")
			puts "-----> Installing Javascript Dependencies & Pre-compiling Assets ... "
			if system("bundle exec rails assets:precompile")
				puts "-----> Running Web Server ... "
				if system("foreman start -f Procfile")
					puts "-----> Launched Application ... Success."
				end
				exit 0
			end
		end		
	end
end

buildpacker = Buildpacker.new
buildpacker.pack

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
smartcloud-0.0.80 lib/smartcloud/grids/grid-runner/buildpacks/buildpacker.rb
smartcloud-0.0.79 lib/smartcloud/grids/grid-runner/buildpacks/buildpacker.rb
smartcloud-0.0.78 lib/smartcloud/grids/grid-runner/buildpacks/buildpacker.rb