-
-
Save renoirb/2f66f413e0002fc546798da26fe0c992 to your computer and use it in GitHub Desktop.
Symfony4 BFF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "cgi/bfff", | |
"type": "project", | |
"require": { | |
"symfony/expression-language": "^4.0.0-RC2", | |
"symfony/dotenv": "^4.0.0-RC2", | |
"doctrine/orm": "^2.5", | |
"symfony/intl": "^4.0.0-RC2", | |
"symfony/translation": "^4.0.0-RC2", | |
"symfony/validator": "^4.0.0-RC2", | |
"symfony/filesystem": "^4.0.0-RC2", | |
"symfony/http-foundation": "^4.0.0-RC2", | |
"symfony/http-kernel": "^4.0.0-RC2", | |
"symfony/dependency-injection": "^4.0.0-RC2", | |
"symfony/workflow": "^4.0.0-RC2", | |
"symfony/config": "^4.0.0-RC2", | |
"symfony/event-dispatcher": "^4.0.0-RC2", | |
"symfony/yaml": "^4.1@dev" | |
}, | |
"require-dev": { | |
"symfony/var-dumper": "^4.1@dev" | |
}, | |
"license": "proprietary", | |
"authors": [ | |
{ | |
"name": "Renoir Boulanger", | |
"email": "hello@renoirboulanger.com" | |
} | |
], | |
"minimum-stability": "dev" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IMAGE_NAMESPACE := u360maindr.cangis.cgi.com:5000/unify360 | |
IMAGE_NAME := $(IMAGE_NAMESPACE)/bff | |
DOCKER_ENGINE := $(shell docker ps > /dev/null ; echo $$?) | |
.DEFAULT: list | |
.PHONY: list | |
list: | |
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs | |
.env: | |
touch .env | |
bin/: | |
mkdir -p bin | |
bin/phpcs: bin/ | |
@test -e bin/phpcs || curl -sL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar -o bin/phpcs | |
@chmod +x bin/phpcs | |
.PHONY: phpcs | |
phpcs: bin/phpcs | |
ifeq ($(value DOCKER_ENGINE), 1) | |
@echo "Will be run using local runime" | |
bin/phpcs --standard=.phpcs.xml -s src/ tests/ | |
else | |
@echo "Will be run through docker" | |
docker run -it --rm --workdir /data -u webapp --volume $(CURDIR):/data $(IMAGE_NAMESPACE)/alpine-images/php7:master php bin/phpcs --standard=.phpcs.xml -s src/ tests/ | |
endif | |
bin/phpunit: bin/ | |
@test -e bin/phpunit || curl -sL https://phar.phpunit.de/phpunit.phar -o bin/phpunit | |
@chmod +x bin/phpunit | |
bin/php-cs-fixer: bin/ | |
@test -e bin/php-cs-fixer || curl -sL http://cs.sensiolabs.org/download/php-cs-fixer-v2.phar -o bin/php-cs-fixer | |
@chmod +x bin/php-cs-fixer | |
.PHONY: test | |
test: bin/phpunit vendor/ | |
ifeq ($(value DOCKER_ENGINE), 1) | |
@echo "Will be run using local runime" | |
bin/phpunit | |
else | |
@echo "Will be run through docker" | |
docker run -it --rm --workdir /data -u webapp --volume $(CURDIR):/data $(IMAGE_NAMESPACE)/alpine-images/php7:master php bin/phpunit | |
endif | |
.PHONY: fix | |
fix: bin/php-cs-fixer | |
ifeq ($(value DOCKER_ENGINE), 1) | |
@echo "Will be run using local runime" | |
bin/php-cs-fixer fix --config=.php_cs | |
else | |
@echo "Will be run through docker" | |
docker run -it --rm --workdir /data -u webapp --volume $(CURDIR):/data $(IMAGE_NAMESPACE)/alpine-images/php7:master php bin/php-cs-fixer fix --config=.php_cs | |
endif | |
vendor: | |
ifeq ($(value DOCKER_ENGINE), 1) | |
@echo "Will be run using local runime" | |
composer install --prefer-dist --no-progress --no-suggest | |
else | |
@echo "Will be run through docker" | |
docker run -it --rm --workdir /data -u webapp --volume $(CURDIR):/data $(IMAGE_NAMESPACE)/alpine-images/php7:master composer install --prefer-dist --no-progress --no-suggest | |
endif | |
.PHONY: update | |
update: vendor | |
ifeq ($(value DOCKER_ENGINE), 1) | |
@echo "Will be run using local runime" | |
composer update | |
else | |
@echo "Will be run through docker" | |
docker run -it --rm --workdir /data -u webapp --volume $(CURDIR):/data $(IMAGE_NAMESPACE)/alpine-images/php7:master composer update | |
endif | |
default: test | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://gist.github.com/renoirb/7305b8c767496934dc707525aa514b74
For inspiration