forked from heroku/heroku-buildpack-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (27 loc) · 1.32 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# These targets are not files
.PHONY: lint lint-scripts lint-ruby compile publish
STACK ?= heroku-22
PLATFORM := linux/amd64
FIXTURE ?= spec/fixtures/python_version_unspecified
# Converts a stack name of `heroku-NN` to its build Docker image tag of `heroku/heroku:NN-build`.
STACK_IMAGE_TAG := heroku/$(subst -,:,$(STACK))-build
lint: lint-scripts lint-ruby
# TODO: Enable scanning for files that are currently missed and/or restructure repo
# layout to make it more viable to use wildcards here, given:
# https://github.com/koalaman/shellcheck/issues/962
lint-scripts:
@shellcheck -x bin/compile bin/detect bin/release bin/test-compile bin/utils bin/warnings bin/default_pythons
@shellcheck -x bin/steps/collectstatic bin/steps/nltk bin/steps/pip-install bin/steps/pipenv bin/steps/pipenv-python-version bin/steps/python
@shellcheck -x bin/steps/hooks/*
@shellcheck -x vendor/WEB_CONCURRENCY.sh
@shellcheck -x builds/*.sh
lint-ruby:
@bundle exec rubocop
compile:
@echo "Running compile using: STACK=$(STACK) FIXTURE=$(FIXTURE)"
@echo
@docker run --rm -it -v $(PWD):/src:ro -e "STACK=$(STACK)" -w /buildpack --platform="$(PLATFORM)" "$(STACK_IMAGE_TAG)" \
bash -c 'cp -r /src/{bin,requirements,vendor} /buildpack && cp -r /src/$(FIXTURE) /build && mkdir /cache /env && bin/compile /build /cache /env'
@echo
publish:
@etc/publish.sh