Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Řešení bez bonusu #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: "3"

services:
php:
build:
dockerfile: php/Dockerfile
context: .
args:
HOST_USER_UID: 1000
HOST_USER_GID: 1000
image: intraworlds/workshop-testing
working_dir: /usr/src
user: developer
volumes:
- ..:/usr/src
22 changes: 22 additions & 0 deletions .docker/php/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM php:7.2-cli-alpine

MAINTAINER Zdeněk Zahoř <[email protected]>

# Parametry uživatele "Developer"
ARG HOST_USER_GID
ARG HOST_USER_UID
ARG USER_LOGIN=developer

RUN \
apk update && \
# Přidání uživatele "Developer"
apk add --no-cache shadow && \
groupadd --gid $HOST_USER_GID $USER_LOGIN && \
useradd --uid $HOST_USER_UID --gid $HOST_USER_GID $USER_LOGIN --comment "Developer" --create-home && \
# Xdebug
apk add --no-cache --virtual .build-deps--xdebug autoconf g++ make && \
pecl install xdebug && \
apk del .build-deps--xdebug && \
docker-php-ext-enable xdebug && \
# Composer
curl --silent --location https://raw.githubusercontent.com/composer/getcomposer.org/master/web/installer | php -- --install-dir=/usr/local/bin --filename=composer
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,13 @@ Odevzdat úkol můžete dvěma způsoby:

### Řešení
Bude zveřejněno během workshopu v úterý 29. 5. 2018, přijďte :-)

### Instalace
```
$ docker-compose -f .docker/docker-compose.yml run --rm php composer install
```

### Spuštění testů
```
$ docker-compose -f .docker/docker-compose.yml run --rm php composer test
```
39 changes: 21 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
{
"require": {
"php": ">=7.1.0"
},
"require-dev": {
"phpunit/phpunit": "7.1.*"
},
"autoload": {
"psr-4": {
"IW\\Workshop\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"IW\\Tests\\Workshop\\": "tests/"
}
}
}
{
"require": {
"php": ">=7.1.0"
},
"require-dev": {
"phpunit/phpunit": "7.1.*"
},
"autoload": {
"psr-4": {
"IW\\Workshop\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"IW\\Tests\\Workshop\\": "tests/"
}
},
"scripts": {
"test": "phpunit"
}
}
Loading