Skip to content

Commit

Permalink
Move target buildpack to a tmp dir before executing
Browse files Browse the repository at this point in the history
  • Loading branch information
jkutner committed Feb 24, 2020
1 parent ad7c242 commit eece775
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SHELL=/bin/bash -o pipefail

GO111MODULE := on

VERSION := "v0.0.5"
VERSION := "v0.1"

build:
@GOOS=linux go build -o "bin/release" ./cmd/release/...
Expand Down
8 changes: 7 additions & 1 deletion bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ set -o pipefail
set -eu

bp_dir=$(cd $(dirname $0)/..; pwd) # absolute path
target_dir="${bp_dir}/target"
source_dir="${bp_dir}/target"

layers_dir="${1:?}"
platform_dir="${2:?}"

# copy the buildpack source into the target dir
target_dir="$(mktemp -d)/target"
cp -R "$source_dir" "$target_dir"
chmod -R +w "$target_dir"

# create a shim cache layer
cache_dir="${layers_dir}/shim"
mkdir -p "${cache_dir}"
Expand Down

0 comments on commit eece775

Please sign in to comment.