1
0
mirror of synced 2025-01-18 17:01:41 +03:00

50 lines
1.6 KiB
Makefile
Raw Normal View History

2020-12-17 13:48:10 +03:00
ROOT_DIR=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
VERSION = `cat $(ROOT_DIR)/VERSION`
ARCHIVE_NAME = '/tmp/retailcrm-'$(VERSION)'.ocmod.zip'
2020-02-27 14:12:42 +03:00
.PHONY: test
2020-02-25 14:36:12 +03:00
svn_clone:
mkdir /tmp/svn_plugin_dir
svn co $(SVNREPOURL) /tmp/svn_plugin_dir --username $(USERNAME) --password $(PASSWORD) --no-auth-cache
2019-03-20 15:56:37 +03:00
svn_push: /tmp/svn_plugin_dir
if [ ! -d "/tmp/svn_plugin_dir/tags/$(VERSION)" ]; then \
svn delete /tmp/svn_plugin_dir/trunk/*; \
rm -rf /tmp/svn_plugin_dir/trunk/*; \
2020-12-17 13:48:10 +03:00
cp -R $(ROOT_DIR)/src/* /tmp/svn_plugin_dir/trunk; \
2019-03-20 15:56:37 +03:00
svn copy /tmp/svn_plugin_dir/trunk /tmp/svn_plugin_dir/tags/$(VERSION) --username $(USERNAME) --password $(PASSWORD) --no-auth-cache; \
svn add /tmp/svn_plugin_dir/trunk/* --force; \
svn add /tmp/svn_plugin_dir/tags/$(VERSION)/* --force; \
svn ci /tmp/svn_plugin_dir -m $(VERSION) --username $(USERNAME) --password $(PASSWORD) --no-auth-cache; \
fi
remove_dir:
rm -rf /tmp/svn_plugin_dir
2020-02-25 13:45:17 +03:00
compile_pot:
msgfmt resources/pot/retailcrm-ru_RU.pot -o src/languages/retailcrm-ru_RU.mo
msgfmt resources/pot/retailcrm-es_ES.pot -o src/languages/retailcrm-es_ES.mo
install:
2020-12-17 13:48:10 +03:00
mkdir coverage
2020-02-28 16:32:18 +03:00
bash tests/bin/install.sh $(DB_NAME) $(DB_USER) $(DB_HOST) $(WP_VERSION) $(WC_VERSION) $(DB_PASS) $(SKIP_DB_CREATE)
2020-02-25 13:45:17 +03:00
2020-02-27 14:12:42 +03:00
test:
2020-02-25 13:45:17 +03:00
phpunit -c phpunit.xml.dist
2020-02-27 14:12:42 +03:00
local_test: install
phpunit -c phpunit.xml.dist
2020-03-25 10:35:08 +03:00
run_tests:
docker-compose --no-ansi up -d --build mysql
docker-compose --no-ansi run --rm --no-deps app make local_test
docker-compose stop
2020-12-17 13:48:10 +03:00
coverage:
wget https://phar.phpunit.de/phpcov-2.0.2.phar && php phpcov-2.0.2.phar merge coverage/ --clover coverage.xml
build_archive:
zip -r $(ARCHIVE_NAME) ./src/*