File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ COMPONENTS_RUNNERS := $(wildcard /tmp/st2/contrib/runners/*)
2222all : requirements lint packs-resource-register packs-tests
2323
2424.PHONY : all-ci
25- all-ci : compile .flake8 .pylint .copy-pack-to-subdirectory .configs-check .metadata-check .packs-resource-register .packs-tests
25+ all-ci : compile .license-check . flake8 .pylint .copy-pack-to-subdirectory .configs-check .metadata-check .packs-resource-register .packs-tests
2626
2727.PHONY : lint
2828lint : requirements flake8 pylint configs-check metadata-check
@@ -195,6 +195,24 @@ compile:
195195 st2-check-print-pack-tests-coverage $(ROOT_DIR ) || exit 1; \
196196 fi ;
197197
198+ # Target which veries repo root contains LICENSE file with ASF 2.0 content
199+ .PHONY : .license-check
200+ .license-check :
201+ @echo
202+ @echo " ==================== license-check ===================="
203+ @echo
204+ if [ -z " ${CHANGED_FILES} " ] && [ " $$ {FORCE_CHECK_ALL_FILES}" = " false" ]; then \
205+ echo " No files have changed, skipping run..." ; \
206+ else \
207+ if [ ! -f " $( ROOT_DIR) /LICENSE" ]; then \
208+ echo " Missing LICENSE file in $( ROOT_DIR) " ; \
209+ exit 2; \
210+ fi ; \
211+ cat $(ROOT_DIR ) /LICENSE | grep -q " Apache License" || (echo " LICENSE file doesn't contain Apache 2.0 license text" ; exit 2); \
212+ cat $(ROOT_DIR ) /LICENSE | grep -q " Version 2.0" || (echo " LICENSE file doesn't contain Apache 2.0 license text" ; exit 2); \
213+ cat $(ROOT_DIR ) /LICENSE | grep -q " www.apache.org/licenses/LICENSE-2.0" || (echo " LICENSE file doesn't contain Apache 2.0 license text" ; exit 2); \
214+ fi ;
215+
198216.PHONY : .clone_st2_repo
199217.clone_st2_repo : /tmp/st2
200218/tmp/st2 :
You can’t perform that action at this time.
0 commit comments