Skip to content

Commit 0dde52d

Browse files
authored
Improve make run (#1636)
The `make run` target provides a quick way to execute the buildpack locally in a container when developing on the buildpack. Previously it executed only `bin/{detect,compile,report}`. Now it also runs `bin/release`. In addition, the arguments passed to `bin/detect` have been corrected, so that they now match the Buildpack API (where only `BUILD_DIR` is passed to the script): https://devcenter.heroku.com/articles/buildpack-api#bin-detect
1 parent b5bbcb7 commit 0dde52d

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Makefile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ run:
1919
@echo "Running buildpack using: STACK=$(STACK) FIXTURE=$(FIXTURE)"
2020
@docker run --rm -it -v $(PWD):/src:ro --tmpfs /app -e "HOME=/app" -e "STACK=$(STACK)" "$(STACK_IMAGE_TAG)" \
2121
bash -eo pipefail -c '\
22-
mkdir /tmp/buildpack /tmp/build /tmp/cache /tmp/env \
23-
&& cp -r /src/{bin,lib,requirements,vendor} /tmp/buildpack \
24-
&& cp -rT /src/$(FIXTURE) /tmp/build \
25-
&& cd /tmp/buildpack \
26-
&& echo -e "\n~ Detect:" && bash ./bin/detect /tmp/build /tmp/cache /tmp/env \
27-
&& echo -e "\n~ Compile:" && { ./bin/compile /tmp/build /tmp/cache /tmp/env || true; } \
28-
&& echo -e "\n~ Report:" && ./bin/report /tmp/build /tmp/cache /tmp/env \
22+
mkdir /tmp/buildpack /tmp/build /tmp/cache /tmp/env; \
23+
cp -r /src/{bin,lib,requirements,vendor} /tmp/buildpack; \
24+
cp -rT /src/$(FIXTURE) /tmp/build; \
25+
cd /tmp/buildpack; \
26+
echo -e "\n~ Detect:" && ./bin/detect /tmp/build; \
27+
echo -e "\n~ Compile:" && { ./bin/compile /tmp/build /tmp/cache /tmp/env || SKIP_RELEASE=1; }; \
28+
echo -e "\n~ Report:" && ./bin/report /tmp/build /tmp/cache /tmp/env; \
29+
[[ -n "$${SKIP_RELEASE}" ]] || { echo -e "\n~ Release:" && ./bin/release /tmp/build && echo -e "\nBuild successful!"; }; \
2930
'
3031
@echo
3132

0 commit comments

Comments
 (0)