Permalink
Browse files

Ensure all buildpack files have executable perms

Change-Id: Ia2707504dc3fe4eee3b50d3012936ac4ea20cdbb
  • Loading branch information...
1 parent 78d2dbe commit 806bd6e08d235e2c8ac97f1a7fece281b60bacbd Jennifer Hickey and Tim Labeeuw committed Feb 12, 2013
Showing with 13 additions and 1 deletion.
  1. +1 −0 lib/vcap/staging/plugin/buildpack/plugin.rb
  2. +11 −0 spec/unit/buildpack_spec.rb
  3. +1 −1 vendor/buildpacks/java
View
1 lib/vcap/staging/plugin/buildpack/plugin.rb
@@ -11,6 +11,7 @@ def stage_application
Dir.chdir(destination_directory) do
create_app_directories
copy_source_files
+ FileUtils.chmod_R(0744, app_dir)
Bundler.with_clean_env do
build_pack.compile
end
View
11 spec/unit/buildpack_spec.rb
@@ -34,6 +34,17 @@
end
end
+ it "ensures all files have executable permissions" do
+ stage staging_env do |staged_dir|
+ Dir.glob("#{staged_dir}/app/*").each do |file|
+ expect(File.stat(file).mode.to_s(8)[3..5]).to eq("744") unless File.directory? file
+ end
+ start_script = File.join(staged_dir, 'startup')
+ script_body = File.read(start_script)
+ expect(script_body).to include('export FROM_BUILD_PACK="${FROM_BUILD_PACK:-yes}"')
+ end
+ end
+
it "stores everything in profile" do
stage staging_env do |staged_dir|
start_script = File.join(staged_dir, 'startup')
2 vendor/buildpacks/java
@@ -1 +1 @@
-Subproject commit da521009f6f1b985e0709fae468fcf3cbab67b9d
+Subproject commit da0d854b89c4251b93608146c445b7a5e814ca96

0 comments on commit 806bd6e

Please sign in to comment.