2020-12-15 13:50:54 +03:00
|
|
|
ROOT_DIR=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
|
|
|
VERSION = `cat $(ROOT_DIR)/VERSION`
|
2020-02-18 16:16:39 +03:00
|
|
|
ARCHIVE_NAME = '/tmp/retailcrm-'$(VERSION)'.ocmod.zip'
|
2018-06-13 17:35:29 +03:00
|
|
|
|
2020-08-07 12:39:59 +03:00
|
|
|
.PHONY: coverage
|
|
|
|
|
2018-06-13 17:35:29 +03:00
|
|
|
all: build_archive send_to_ftp delete_archive
|
|
|
|
|
|
|
|
build_archive:
|
|
|
|
zip -r $(ARCHIVE_NAME) ./src/*
|
|
|
|
|
|
|
|
send_to_ftp:
|
|
|
|
curl -T $(ARCHIVE_NAME) -u $(FTP_USER):$(FTP_PASSWORD) ftp://$(FTP_HOST)
|
|
|
|
|
|
|
|
delete_archive:
|
2020-02-18 10:50:40 +03:00
|
|
|
rm -f $(ARCHIVE_NAME)
|
|
|
|
|
|
|
|
before_script:
|
2020-02-18 18:22:03 +03:00
|
|
|
mkdir coverage
|
2020-02-19 10:50:24 +03:00
|
|
|
composer require --dev beyondit/opencart-test-suite ~$(TEST_SUITE)
|
2020-02-19 18:17:23 +03:00
|
|
|
composer require --dev opencart/opencart $(OPENCART)
|
2020-02-18 10:50:40 +03:00
|
|
|
composer setup
|
|
|
|
bin/robo --load-from tests/RoboFile.php project:deploy
|
2020-02-20 15:26:18 +03:00
|
|
|
(php -S localhost:80 -t www &) 2> /dev/null > /dev/null
|
2020-02-18 12:53:31 +03:00
|
|
|
sleep 2
|
2020-02-19 15:17:18 +03:00
|
|
|
|
2020-02-19 17:29:21 +03:00
|
|
|
coverage:
|
2020-02-18 21:39:46 +03:00
|
|
|
wget https://phar.phpunit.de/phpcov-2.0.2.phar && php phpcov-2.0.2.phar merge coverage/ --clover coverage.xml
|
2020-04-10 11:36:10 +03:00
|
|
|
|
|
|
|
robo_deploy:
|
|
|
|
bin/robo --load-from tests/RoboFile.php project:deploy
|
|
|
|
|
2020-08-07 12:39:59 +03:00
|
|
|
run:
|
2020-04-10 11:36:10 +03:00
|
|
|
composer require --dev beyondit/opencart-test-suite ~$(TEST_SUITE)
|
|
|
|
composer require --dev opencart/opencart $(OPENCART)
|
|
|
|
composer setup
|
|
|
|
bin/robo --load-from tests/RoboFile.php project:deploy
|
2020-08-07 12:39:59 +03:00
|
|
|
|
|
|
|
run_test: run
|
|
|
|
(php -S localhost:$(SERVER_PORT) -t www &) 2> /dev/null > /dev/null
|
2020-04-10 11:36:10 +03:00
|
|
|
sleep 2
|
|
|
|
composer test
|
2020-08-07 12:39:59 +03:00
|
|
|
|
|
|
|
test: robo_deploy
|
|
|
|
composer test
|
2020-09-25 10:39:00 +03:00
|
|
|
|
|
|
|
phpcs-config:
|
|
|
|
bin/phpcs --config-set installed_paths vendor/phpcompatibility/php-compatibility
|
|
|
|
|
|
|
|
phpcomp: phpcs-config
|
|
|
|
@bin/phpcs -s -p ./src --standard=PHPCompatibility --runtime-set testVersion 5.4-7.3
|