Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
install fastboot-cli for the new fastboot-app-server rearch
Browse files Browse the repository at this point in the history
  • Loading branch information
hone committed May 20, 2016
1 parent 2f074c2 commit 137c9c4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
4 changes: 4 additions & 0 deletions buildpack/mrblib/buildpack/commands/compile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ def run
@output_io.topic "Caching fastboot dependencies"
@cache.store("#{cache_tuple.destination}/node_modules", cache_tuple.source)

unless command_success?("node_modules/.bin/ember-fastboot 2> /dev/null")
@output_io.topic "ember-fastboot command not detected, installing fastboot-cli"
pipe_exit_on_error("npm install fastboot-cli", @output_io, @error_io, @env)
end
release_yml = {
"default_process_types" => {
"web" => "ember-fastboot #{tuple.output_dir} --serve-assets-from #{tuple.output_dir} --port $PORT"
Expand Down
24 changes: 23 additions & 1 deletion buildpack/spec/compile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,36 @@
end
end

it "should compile a fastboot build app" do
it "should compile an older fastboot build app" do
Dir.mktmpdir do |dir|
Dir.chdir(dir) do
assert_compile(dir, "ember-cli-deploy-fastboot-build")
end
end
end

it "should setup the fastboot-cli for newer fastboot apps" do
Dir.mktmpdir do |tmpdir|
Dir.chdir(tmpdir) do
tuple = Tuple.new("fastboot-cli", "dist")

cache_dir = "#{tmpdir}/cache"
env_dir = "#{tmpdir}/env"
Dir.mkdir(cache_dir)
Dir.mkdir(env_dir)
File.open("#{env_dir}/FASTLY_CDN_URL", "w") do |file|
"limitless-caverns-12345.global.ssl.fastly.net"
end
work_dir = "#{tmpdir}/#{tuple.app}"
FileUtils.cp_r(fixtures(tuple.app), tmpdir)

output, _, status = run_bin('compile', work_dir, cache_dir, env_dir)
expect(output).to include("installing fastboot-cli")
expect(status).to be_success
end
end
end

it "should clear bower cache if bower.json changes" do
Dir.mktmpdir do |tmpdir|
Dir.chdir(tmpdir) do
Expand Down

0 comments on commit 137c9c4

Please sign in to comment.