Skip to content

Commit

Permalink
Merge develop into master
Browse files Browse the repository at this point in the history
  • Loading branch information
cf-buildpacks-eng authored Aug 7, 2017
2 parents ca20f5b + 84eb233 commit b01e39a
Show file tree
Hide file tree
Showing 50 changed files with 1,191 additions and 664 deletions.
3 changes: 2 additions & 1 deletion .bundle/config
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
BUNDLE_GEMFILE: cf.Gemfile
BUNDLE_GEMFILE: "cf.Gemfile"
BUNDLE_BIN: ".bin"
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export PATH=$PWD/.bin:$PATH
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dependencies/
dotnet-core_buildpack-*.zip
log/
/.bin/
9 changes: 9 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
v1.0.24 Aug 07, 2017
=====================

* Add support for multi buildpack
(https://www.pivotaltracker.com/story/show/142852043)

* Add node 6.11.2, remove node 6.11.1
(https://www.pivotaltracker.com/story/show/149837609)

v1.0.23 Jul 21, 2017
=====================

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.23
1.0.24
20 changes: 13 additions & 7 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

`dirname $0`/compile.rb "$@" | tee -a staging_task.log
exit_status=${PIPESTATUS[0]}
if [ $exit_status -ne 0 ]; then
exit $exit_status
fi
mkdir -p $1/logs
cp -f staging_task.log $1/logs/staging_task.log
#!/bin/bash
set -euo pipefail

BUILD_DIR=$1
CACHE_DIR=$2
export BUILDPACK_DIR=`dirname $(readlink -f ${BASH_SOURCE%/*})`
export DEPS_DIR="$BUILD_DIR/.cloudfoundry"
mkdir -p "$DEPS_DIR/0"
mkdir -p "$BUILD_DIR/.profile.d"
echo "export DEPS_DIR=\$HOME/.cloudfoundry" > "$BUILD_DIR/.profile.d/0000_set-deps-dir.sh"

$BUILDPACK_DIR/bin/supply "$BUILD_DIR" "$CACHE_DIR" "$DEPS_DIR" 0
$BUILDPACK_DIR/bin/finalize "$BUILD_DIR" "$CACHE_DIR" "$DEPS_DIR" 0
24 changes: 24 additions & 0 deletions bin/finalize
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
# Encoding: utf-8
# ASP.NET Core Buildpack
# Copyright 2017 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

`dirname $0`/finalize.rb "$@" | tee -a staging_task.log
exit_status=${PIPESTATUS[0]}
if [ $exit_status -ne 0 ]; then
exit $exit_status
fi
mkdir -p $1/logs
cp -f staging_task.log $1/logs/staging_task.log
54 changes: 54 additions & 0 deletions bin/finalize.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env ruby
# Encoding: utf-8
# ASP.NET Core Buildpack
# Copyright 2014-2016 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
build_dir = ARGV[0]
cache_dir = ARGV[1]
deps_dir = ARGV[2]
deps_idx = ARGV[3]
buildpack_dir = File.join(File.dirname(__FILE__), '..')
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)

require 'buildpack'
require 'open3'

if deps_dir
stdout, stderr, status = Open3.capture3("#{buildpack_dir}/compile-extensions/bin/build_path_from_supply #{deps_dir}")

if status.exitstatus.nonzero?
puts "build_path_from_supply script failed: #{stdout} \n====\n #{stderr}"
exit 1
end

stdout.split("\n").each do |line|
var, val = line.split('=')
ENV[var] = val
end
end

if AspNetCoreBuildpack.finalize(build_dir, cache_dir, deps_dir, deps_idx)
system("#{buildpack_dir}/compile-extensions/bin/store_buildpack_metadata #{buildpack_dir} #{cache_dir}")
if deps_dir
stdout, stderr, status = Open3.capture3("#{buildpack_dir}/compile-extensions/bin/write_profiled_from_supply #{deps_dir} #{build_dir}")
if status.exitstatus.nonzero?
puts "write_profiled_from_supply failed: #{stdout} \n====\n #{stderr}"
exit 1
end
end
exit 0
else
exit 1
end
7 changes: 3 additions & 4 deletions bin/release
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@

$stdout.sync = true
$stderr.sync = true
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)

require 'buildpack'
require 'pathname'

build_dir = ARGV[0]

puts AspNetCoreBuildpack.release(build_dir)
release = Pathname.new(build_dir).join('tmp/dotnet-core-buildpack-release-step.yml')
puts release.read if release.exist?
24 changes: 24 additions & 0 deletions bin/supply
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
# Encoding: utf-8
# ASP.NET Core Buildpack
# Copyright 2017 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

`dirname $0`/supply.rb "$@" | tee -a staging_task.log
exit_status=${PIPESTATUS[0]}
if [ $exit_status -ne 0 ]; then
exit $exit_status
fi
mkdir -p $1/logs
cp -f staging_task.log $1/logs/staging_task.log
12 changes: 4 additions & 8 deletions bin/compile.rb → bin/supply.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@

build_dir = ARGV[0]
cache_dir = ARGV[1]
deps_dir = ARGV[3]
deps_dir = ARGV[2]
deps_idx = ARGV[3]
buildpack_dir = File.join(File.dirname(__FILE__), '..')

version = File.read(File.join(buildpack_dir, 'VERSION')).strip
Expand All @@ -44,16 +45,11 @@
var, val = line.split('=')
ENV[var] = val
end

stdout, stderr, status = Open3.capture3("#{buildpack_dir}/compile-extensions/bin/write_profiled_from_supply #{deps_dir} #{build_dir}")
if status.exitstatus.nonzero?
puts "write_profiled_from_supply failed: #{stdout} \n====\n #{stderr}"
exit 1
end
end

if AspNetCoreBuildpack.compile(build_dir, cache_dir)
if AspNetCoreBuildpack.supply(build_dir, cache_dir, deps_dir, deps_idx)
system("#{buildpack_dir}/compile-extensions/bin/store_buildpack_metadata #{buildpack_dir} #{cache_dir}")
system("#{buildpack_dir}/compile-extensions/bin/write_config_yml #{buildpack_dir} #{deps_dir}/#{deps_idx}") || raise('Could not write config.yml')
exit 0
else
exit 1
Expand Down
4 changes: 2 additions & 2 deletions cf.Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source "https://rubygems.org"

gem 'machete', git: 'https://github.com/cloudfoundry/machete', tag: 'v0.0.69'
gem 'buildpack-packager', git: 'https://github.com/cloudfoundry/buildpack-packager', tag: 'v2.3.9'
gem 'machete', git: 'https://github.com/cloudfoundry/machete', tag: 'v0.0.71'
gem 'buildpack-packager', git: 'https://github.com/cloudfoundry/buildpack-packager', tag: 'v2.3.10'
gem 'rspec'
gem 'rspec-instafail'
gem 'rspec-retry'
Expand Down
22 changes: 11 additions & 11 deletions cf.Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
GIT
remote: https://github.com/cloudfoundry/buildpack-packager
revision: 12fafa8a695dfb6003bc3297063ce85c1494f77b
tag: v2.3.9
revision: fcfd9704ee708410156161f7f0493b787a3e1f61
tag: v2.3.10
specs:
buildpack-packager (2.3.9)
buildpack-packager (2.3.10)
activesupport (~> 4.1)
kwalify (~> 0)
semantic
terminal-table (~> 1.4)

GIT
remote: https://github.com/cloudfoundry/machete
revision: d3350a2c4ed9669ee318994820e8607971031071
tag: v0.0.69
revision: 7b909eb0ae81ebf10697af67fa130ea5cfce036b
tag: v0.0.71
specs:
machete (0.0.69)
machete (0.0.71)
childprocess
httparty

GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.8)
activesupport (4.2.9)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
Expand All @@ -41,16 +41,16 @@ GEM
coderay (1.1.1)
diff-lcs (1.2.5)
ffi (1.9.18)
httparty (0.15.5)
httparty (0.15.6)
multi_xml (>= 0.5.2)
i18n (0.8.4)
i18n (0.8.6)
kwalify (0.7.2)
method_source (0.8.2)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
minitest (5.10.2)
minitest (5.10.3)
multi_xml (0.6.0)
nokogiri (1.6.8.1)
mini_portile2 (~> 2.1.0)
Expand Down Expand Up @@ -126,4 +126,4 @@ DEPENDENCIES
rubocop

BUNDLED WITH
1.15.2
1.15.3
2 changes: 1 addition & 1 deletion cf_spec/fixtures/angular/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
applications:
- name: angular
disk_quota: 1536M
memory: 2G
memory: 1G
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
CACHE_NUGET_PACKAGES: false
2 changes: 1 addition & 1 deletion cf_spec/fixtures/angular_msbuild/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
applications:
- name: angular_msbuild
disk_quota: 1536M
memory: 2G
memory: 1G
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
CACHE_NUGET_PACKAGES: false
Expand Down
4 changes: 2 additions & 2 deletions cf_spec/integration/deploy_dotnetcore_app_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
it 'logs dotnet run verbose output' do
expect(app).to be_running
expect(app).to have_logged(/Process ID:/)
expect(app).to have_logged(/Running \/home\/vcap\/app\/\.dotnet\/dotnet/)
expect(app).to have_logged(%r{Running .*/0/dotnet/dotnet})
end
end
end
Expand Down Expand Up @@ -109,7 +109,7 @@

it 'displays a simple text homepage' do
expect(app).to be_running
expect(app).to have_logged(%r{Removing /tmp/app/\.dotnet})
expect(app).to have_logged(%r{Removing .*/0/dotnet})
expect(app).to have_logged(%r{started using .* \./msbuild_self_contained })

browser.visit_path('/')
Expand Down
8 changes: 5 additions & 3 deletions cf_spec/unit/buildpack/app_dir_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@

describe AspNetCoreBuildpack::AppDir do
let(:dir) { Dir.mktmpdir }
let(:deps_dir) { Dir.mktmpdir }
let(:deps_idx) { '55' }
let(:app_uses_msbuild) { false }
let(:app_uses_project_json) { true }

subject(:appdir) { described_class.new(dir) }
subject(:appdir) { described_class.new(dir, deps_dir, deps_idx) }

before do
allow(appdir).to receive(:msbuild?).and_return(app_uses_msbuild)
Expand All @@ -38,7 +40,7 @@

let(:proj1) { File.join(dir, 'src', 'proj1').tap { |f| FileUtils.mkdir_p(f) } }
let(:proj2) { File.join(dir, 'src', 'föö').tap { |f| FileUtils.mkdir_p(f) } }
let(:nuget) { File.join(dir, '.nuget', 'dep').tap { |f| FileUtils.mkdir_p(f) } }
let(:nuget) { File.join(dir, '.hidden', 'dep').tap { |f| FileUtils.mkdir_p(f) } }

before do
File.open(File.join(proj1, 'proj1.fsproj'), 'w') do |f|
Expand Down Expand Up @@ -89,7 +91,7 @@
context 'with multiple projects with project.json' do
let(:proj1) { File.join(dir, 'src', 'proj1').tap { |f| FileUtils.mkdir_p(f) } }
let(:proj2) { File.join(dir, 'src', 'föö').tap { |f| FileUtils.mkdir_p(f) } }
let(:nuget) { File.join(dir, '.nuget', 'dep').tap { |f| FileUtils.mkdir_p(f) } }
let(:nuget) { File.join(dir, '.hidden', 'dep').tap { |f| FileUtils.mkdir_p(f) } }

before do
File.open(File.join(proj1, 'project.json'), 'w') do |f|
Expand Down
Loading

0 comments on commit b01e39a

Please sign in to comment.