Skip to content

Commit

Permalink
Use make instead of bin/helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
Chemaclass committed May 28, 2020
1 parent 325fdb5 commit 5f59a2f
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 26 deletions.
57 changes: 57 additions & 0 deletions 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
3 changes: 0 additions & 3 deletions bin/bash

This file was deleted.

8 changes: 0 additions & 8 deletions bin/composer

This file was deleted.

3 changes: 0 additions & 3 deletions bin/csfix

This file was deleted.

9 changes: 0 additions & 9 deletions bin/tests

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion phpunit.xml
Expand Up @@ -2,7 +2,7 @@

<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.1/phpunit.xsd"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/8.5/phpunit.xsd"
backupGlobals="false"
colors="true"
cacheTokens="false"
Expand Down

0 comments on commit 5f59a2f

Please sign in to comment.