Skip to content

Commit be5ea12

Browse files
committed
Foundation for 8.1
Added a docker setup and adjusted deps.
1 parent 38f2fd5 commit be5ea12

File tree

6 files changed

+2285
-2216
lines changed

6 files changed

+2285
-2216
lines changed

Makefile

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# set all to phony
2+
SHELL=bash
3+
4+
.PHONY: *
5+
6+
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
7+
current_dir := $(abspath $(patsubst %/,%,$(dir $(mkfile_path))))
8+
9+
THREADS := $(shell docker info -f '{{ .NCPU }}')
10+
11+
export DOCKER_BUILDKIT=1
12+
export COMPOSE_DOCKER_CLI_BUILD=1
13+
export LOCAL_COMPOSER_HOME=$(shell composer config --global home 2> /dev/null || echo ${HOME}/.config/composer)
14+
export LOCAL_COMPOSER_CACHE_DIR=$(shell composer config --global cache-dir 2> /dev/null || echo ${HOME}/.config/composer/cache)
15+
16+
DOCKER_RUN=@docker run -it --rm \
17+
--volume=$(shell pwd):/opt/project \
18+
amsphp-console-cli
19+
20+
DOCKER_RUN_COMPOSER=@docker run -it --rm \
21+
--volume=${LOCAL_COMPOSER_CACHE_DIR}:/tmp/composer/cache \
22+
--volume=${LOCAL_COMPOSER_HOME}:/.config/composer \
23+
--volume=$(shell pwd):/opt/project \
24+
amsphp-console-cli
25+
26+
DOCKER_RUN_TEST=@docker run -it --rm \
27+
--volume=$(shell pwd):/opt/project \
28+
amsphp-console-cli
29+
30+
DOCKER_RUN_XDEBUG_COVERAGE=@XDEBUG_MODE=coverage docker run -it --rm \
31+
--volume=$(shell pwd):/opt/project \
32+
amsphp-console-cli
33+
34+
all: build composer-install test
35+
36+
install: env-check docker-lint docker-build composer-install ## Builds the project
37+
38+
build:
39+
@echo -e "\033[33mBuilding PHP docker images\033[0m"
40+
@docker build -f docker/cli.Dockerfile -t amsphp-console-cli .
41+
42+
composer-install: ## Install dependencies with composer, according to the existing composer.lock
43+
@echo -e "\033[33mInstalling dependencies\033[0m"
44+
$(DOCKER_RUN_COMPOSER) composer install -n -o
45+
46+
composer-require-checker: env-check ## Checks if all root dependencies are declared
47+
@echo -e "\033[33mChecking composer requirements\033[0m"
48+
$(DOCKER_RUN_COMPOSER) vendor/bin/composer-require-checker check --config-file=composer-require-checker.json
49+
50+
composer-validate: env-check ## Runs composer validate
51+
@echo -e "\033[33mValidating composer.json\033[0m"
52+
$(DOCKER_RUN_COMPOSER) composer validate --no-check-all --strict
53+
54+
test:
55+
@echo -e "\033[33mRunning Tests\033[0m"
56+
$(DOCKER_RUN_TEST) ./vendor/bin/phpunit
57+
58+
run-cmd:
59+
$(DOCKER_RUN) bin/console $(ARGS)
60+
61+
shell: ## Gives shell access inside the container
62+
$(DOCKER_RUN) sh
63+
64+
help:
65+
@echo "\033[33mUsage:\033[0m\n make [target] [FLAGS=\"val\"...]\n\n\033[33mTargets:\033[0m"
66+
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-18s\033[0m %s\n", $$1, $$2}'

composer.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
{
22
"require": {
3-
"symfony/console": "^3.0",
4-
"mcrumm/phlack": "^0.7.0",
5-
"dms/meetup-api-client": "^2.0",
6-
"joindin/api-client": "^0.1.3",
7-
"codeliner/array-reader": "^1.2",
8-
"php-di/php-di": "^5.2",
9-
"vlucas/phpdotenv": "^2.2"
3+
"symfony/console": "^6",
4+
"codeliner/array-reader": "^2",
5+
"php-di/php-di": "^6",
6+
"guzzlehttp/guzzle": "^7.5",
7+
"ext-json": "*",
8+
"ramsey/collection": "^1.2",
9+
"ext-intl": "*"
1010
},
1111

1212
"autoload": {
1313
"psr-4": {
14-
"AmsterdamPHP\\Console\\": ["src/", "tests/"],
15-
"Deployer\\": "vendor/deployer/deployer/"
14+
"AmsterdamPHP\\Console\\": ["src/", "tests/"]
1615
}
1716
},
1817
"require-dev": {
19-
"deployer/deployer": "^4@dev",
20-
"phpunit/phpunit": "^5.3",
21-
"mockery/mockery": "^0.9.5"
18+
"mockery/mockery": "^1",
19+
"phpunit/phpunit": "^9",
20+
"vlucas/phpdotenv": "^5",
21+
"deployer/deployer": "^7"
2222
}
2323
}

0 commit comments

Comments
 (0)