From 5f59a2fa346ba575701379c91a7ef2cb8b445563 Mon Sep 17 00:00:00 2001 From: Chemaclass Date: Thu, 28 May 2020 16:17:57 +0200 Subject: [PATCH] Use make instead of bin/helpers --- Makefile | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ bin/bash | 3 --- bin/composer | 8 -------- bin/csfix | 3 --- bin/tests | 9 -------- composer.json | 2 +- composer.lock | 2 +- phpunit.xml | 2 +- 8 files changed, 60 insertions(+), 26 deletions(-) create mode 100644 Makefile delete mode 100755 bin/bash delete mode 100755 bin/composer delete mode 100755 bin/csfix delete mode 100755 bin/tests diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8ee3e01 --- /dev/null +++ b/Makefile @@ -0,0 +1,57 @@ +SHELL:=/bin/bash +.ONESHELL: + +.PHONY: bash +bash: + @if [[ ! -f /.dockerenv ]]; then + docker exec -ti -u dev jira_status_notifier_php bash + else + echo "You are already into the docker bash."; + fi + +.PHONY: csfix +csfix: + @if [[ -f /.dockerenv ]]; then + cd /srv/jira-status-notifier && vendor/bin/php-cs-fixer fix + else + docker exec -ti -u dev jira_status_notifier_php sh \ + -c "cd /srv/jira-status-notifier && vendor/bin/php-cs-fixer fix" + fi + +# make tests ARGS="--filter AppTest" +.PHONY: tests +tests: + @if [[ -f /.dockerenv ]]; then + cd /srv/jira-status-notifier && vendor/bin/phpunit ${ARGS} --coverage-html coverage; + else + docker exec -ti -u dev jira_status_notifier_php sh \ + -c "cd /srv/jira-status-notifier && vendor/bin/phpunit $(ARGS) --coverage-html coverage" + fi + +# make composer ARGS="require phpunit/phpunit" +.PHONY: composer +composer: + @if [[ -f /.dockerenv ]]; then + cd /srv/jira-status-notifier && composer ${ARGS} + else + docker exec -ti -u dev jira_status_notifier_php sh \ + -c "cd /srv/jira-status-notifier && composer $(ARGS)" + fi + +.PHONY: psalm +psalm: + @if [[ -f /.dockerenv ]]; then + cd /srv/jira-status-notifier && vendor/bin/psalm ${ARGS} + else + docker exec -ti -u dev jira_status_notifier_php sh \ + -c "cd /srv/jira-status-notifier && vendor/bin/psalm ${ARGS}" + fi + +.PHONY: psalm-log +psalm-log: + @if [[ -f /.dockerenv ]]; then + cd /srv/jira-status-notifier && vendor/bin/psalm --output-format=text --show-info=true > psalm.log + else + docker exec -ti -u dev jira_status_notifier_php sh \ + -c "cd /srv/jira-status-notifier && vendor/bin/psalm --output-format=text --show-info=true > psalm.log" + fi diff --git a/bin/bash b/bin/bash deleted file mode 100755 index 7cd244b..0000000 --- a/bin/bash +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -docker exec -ti -u dev edifact_parser_php bash diff --git a/bin/composer b/bin/composer deleted file mode 100755 index 203dbfa..0000000 --- a/bin/composer +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -args="" -for arg in "$@"; do - args="$args $arg" -done - -docker exec -ti -u dev edifact_parser_php sh -c "cd /srv/edifact-parser && composer $args" diff --git a/bin/csfix b/bin/csfix deleted file mode 100755 index bd41b0d..0000000 --- a/bin/csfix +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -docker exec -ti -u dev edifact_parser_php sh -c "cd /srv/edifact-parser && vendor/bin/php-cs-fixer fix" diff --git a/bin/tests b/bin/tests deleted file mode 100755 index fa1b09d..0000000 --- a/bin/tests +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -args="" -for arg in "$@"; do - args="$args $arg" -done - -docker exec -ti -u dev edifact_parser_php sh \ - -c "cd /srv/edifact-parser && vendor/bin/phpunit $args --coverage-html coverage" diff --git a/composer.json b/composer.json index 929d6aa..9ee672b 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "sabas/edifact": "^0.5" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.15", + "friendsofphp/php-cs-fixer": "^2.16", "phpunit/phpunit": "^8.5", "symfony/var-dumper": "^5.0", "vimeo/psalm": "^3.11" diff --git a/composer.lock b/composer.lock index 7471b75..5bb61f2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1cadb92c6369ba91d7aa2e64b5be32d5", + "content-hash": "36cc8215cc53d7651d9ee510497b6e7e", "packages": [ { "name": "phpdocumentor/reflection-common", diff --git a/phpunit.xml b/phpunit.xml index fcf9cf1..da883d1 100755 --- a/phpunit.xml +++ b/phpunit.xml @@ -2,7 +2,7 @@