Skip to content

Commit

Permalink
Merge pull request #3 from temafey/add-docker-remove-broadway-add-mic…
Browse files Browse the repository at this point in the history
…ro-broadway

added docker, removed broadway/broadway, added micro-module/broadway
  • Loading branch information
temafey authored Sep 7, 2021
2 parents 33c8102 + 131fd89 commit 61cc8ed
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 80 deletions.
16 changes: 0 additions & 16 deletions .docker/php7.3-dev/Dockerfile

This file was deleted.

32 changes: 32 additions & 0 deletions .docker/php8.0-dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
ARG PHP_VER

FROM php:8.0-cli-alpine3.13

RUN apk update
RUN apk add --no-cache bash
RUN apk add --no-cache build-base
RUN apk add --no-cache autoconf
RUN apk add --no-cache automake

RUN apk add --no-cache --upgrade bash && \
apk add libpq zip unzip tree

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN mkdir /.composer_cache
ENV COMPOSER_CACHE_DIR /.composer_cache

# curl for cmd
RUN apk add --no-cache curl

#develop layer
RUN pecl install xdebug
RUN docker-php-ext-enable xdebug

# bcmath
RUN docker-php-ext-install bcmath
RUN docker-php-ext-enable bcmath

# intl
RUN apk add --no-cache icu-dev
RUN docker-php-ext-install intl
RUN docker-php-ext-enable intl
11 changes: 1 addition & 10 deletions .env
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
# This file is a "template" of which env vars need to be defined for your application
# Copy this file to .env file for development, create environment variables when deploying to production
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=secret
###< symfony/framework-bundle ###

###> common variables ###
MICROTSK_COMPOSE_PROJECT_NAME=micro-task
MICROTASK_COMPOSE_PROJECT_NAME=micro-task
CI_COMMIT_REF_SLUG=master
###< common variables ###
23 changes: 7 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
version = $(shell git describe --tags --dirty --always)
build_name = application-$(version)
# use the rest as arguments for "run"
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
# ...and turn them into do-nothing targets
#$(eval $(RUN_ARGS):;@:)
$(shell (if [ ! -e .env ]; then cp default.env .env; fi))
include .env
export

RUN_ARGS = $(filter-out $@,$(MAKECMDGOALS))

.PHONY: fix-permission
fix-permission: ## fix permission for docker env
Expand All @@ -15,10 +14,6 @@ build: ## build environment and initialize composer and project dependencies
docker-compose build
make composer-install

.PHONY: stop
stop:
docker-compose stop

.PHONY: composer-install
composer-install: ## Install project dependencies
docker-compose run --rm --no-deps php sh -lc 'composer install'
Expand Down Expand Up @@ -50,11 +45,7 @@ style: ## executes php analizers

.PHONY: lint
lint: ## checks syntax of PHP files
docker-compose run --rm --no-deps php sh -lc './vendor/bin/parallel-lint ./ --exclude vendor --exclude bin/.phpunit'

.PHONY: layer
layer: ## Check issues with layers (deptrac tool)
docker-compose run --rm --no-deps php sh -lc './vendor/bin/deptrac analyze --formatter-graphviz=0'
docker-compose run --rm --no-deps php sh -lc './vendor/bin/parallel-lint ./ --exclude vendor'

.PHONY: logs
logs: ## look for service logs
Expand All @@ -71,7 +62,7 @@ php-shell: ## PHP shell
unit-tests: ## Run unit-tests suite
docker-compose run --rm php sh -lc 'vendor/bin/phpunit --testsuite unit-tests'

static-analysis: style layer coding-standards ## Run phpstan, deprac, easycoding standarts code static analysis
static-analysis: style coding-standards ## Run phpstan, easycoding standarts code static analysis

coding-standards: ## Run check and validate code standards tests
docker-compose run --rm --no-deps php sh -lc 'vendor/bin/ecs check src tests'
Expand Down
22 changes: 11 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,33 @@
"description": "Micro module Task common library",
"license": "proprietary",
"require": {
"php": "^7.3 || ^8.0",
"php": "^8.0",
"beberlei/assert": "^3.2",
"broadway/broadway": "^2.2",
"queue-interop/amqp-interop": "^0.8",
"queue-interop/queue-interop": "^0.7|^0.8",
"enqueue/enqueue": "^0.10",
"enqueue/fs": "^0.10",
"enqueue/null": "^0.10",
"league/tactician-bundle": "^1.1",
"micro-module/tactician-command-events": "~0.7",
"micro-module/base": "~0.7",
"micro-module/base": "^0.7.0",
"micro-module/broadway": "^2.6",
"micro-module/job-queue": "~0.10",
"psr/log": "^1.1"
"micro-module/tactician-command-events": "~0.7",
"psr/log": "^1.1",
"queue-interop/amqp-interop": "^0.8",
"queue-interop/queue-interop": "^0.7|^0.8"
},
"require-dev": {
"mockery/mockery": "^1.3",
"php-parallel-lint/php-console-highlighter": "^0.4",
"php-parallel-lint/php-parallel-lint": "^1.0",
"mockery/mockery": "^1.3",
"phpmd/phpmd": "^2.8",
"phpstan/phpstan": "^0.12",
"phpstan/phpstan-mockery": "^0.12",
"phpstan/phpstan-phpunit": "^0.12",
"phpunit/phpunit": "^9.0",
"roave/security-advisories": "dev-master",
"sensiolabs-de/deptrac-shim": "^0.4",
"symplify/easy-coding-standard": "^7.2",
"vimeo/psalm": "^3.11"
"sensiolabs-de/deptrac-shim": "^0.15.2",
"symplify/easy-coding-standard": "^9.4",
"vimeo/psalm": "^4.10"
},
"config": {
"preferred-install": {
Expand Down
5 changes: 5 additions & 0 deletions default.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
###> common variables ###
MICROTASK_COMPOSE_PROJECT_NAME=micro-task
CI_COMMIT_REF_SLUG=master
PHP_VER=8.0
###< common variables ###
8 changes: 5 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ version: "3.7"

services:
php:
container_name: ${MICROTSK_COMPOSE_PROJECT_NAME}_php
container_name: ${MICROTASK_COMPOSE_PROJECT_NAME}_php
user: 1000:1000
build:
context: .docker/php7.3-dev
context: .docker/php8.0-dev
volumes:
- ~/.composer/cache/:/.composer_cache/:rw
- .:/app:rw
- ./:/app:rw
working_dir: /app
env_file:
- .env
43 changes: 19 additions & 24 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- 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/6.1/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
>
<php>
<ini name="error_reporting" value="-1" />
<env name="APP_ENV" value="test" />
<env name="APP_DEBUG" value="1" />
<env name="MICRODTO_COMPOSE_PROJECT_NAME" value="micro-module-command-bus" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0" />
</php>

<testsuites>
<testsuite name="unit-tests">
<directory>tests/unit</directory>
</testsuite>
</testsuites>

<logging>
<log type="coverage-html" target="var/report/html" lowUpperBound="35" highLowerBound="70"/>
</logging>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="vendor/autoload.php">
<coverage>
<report>
<html outputDirectory="var/report/html" lowUpperBound="35" highLowerBound="70"/>
</report>
</coverage>
<php>
<ini name="error_reporting" value="-1"/>
<env name="APP_ENV" value="test"/>
<env name="APP_DEBUG" value="1"/>
<env name="MICROTASK_COMPOSE_PROJECT_NAME" value="micro-task"/>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0"/>
</php>
<testsuites>
<testsuite name="unit-tests">
<directory>tests/unit</directory>
</testsuite>
</testsuites>
<logging/>
</phpunit>

0 comments on commit 61cc8ed

Please sign in to comment.