-
Notifications
You must be signed in to change notification settings - Fork 7
Add docker image and dockerized dev tools #10
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
149cead
Add Makefile with dockerized dev tools
15b156e
Add Makefile with dockerized dev tools
36d4c96
change composer installation: use latest version
samizdam 94ab57a
Up php version for base docker image
samizdam bd950dc
Add to readme info about development installation with(-out) docker
samizdam 780fade
Review fixes:
samizdam 06c18d0
Fix PATH addition
samizdam e6439f9
Fix dockerized tools
samizdam f1eb359
readme cs fixes
samizdam 78f06d1
Fix dockerfile lints
samizdam 4fa27d0
Fix lint: quote paths
samizdam e0e0945
Disable some dockerfile lint rules
samizdam f830e65
bash quotes
samizdam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ignored: | ||
- DL3003 | ||
- DL3008 | ||
- DL3059 | ||
- DL4006 |
This file contains hidden or 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
/.idea/ | ||
/.phpunit.result.cache | ||
/_coverage/ | ||
/composer.lock | ||
/phpunit.xml | ||
/vendor/ |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM php:7.1 | ||
|
||
# Enable phpdebug | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends libxml2-dev \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& docker-php-source extract \ | ||
&& cd /usr/src/php \ | ||
&& ./configure --enable-phpdbg \ | ||
&& docker-php-source delete | ||
|
||
# Install composer and required packages | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends unzip \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | ||
|
||
WORKDIR /app |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
## Add dockerized commands to path | ||
PATH := $(PATH):tools | ||
|
||
docker-build: | ||
docker build -t timeweb/phpstan-enum . | ||
|
||
install: | ||
composer install | ||
|
||
test: | ||
php vendor/bin/phpunit | ||
|
||
test-coverage: | ||
phpdbg -qrr vendor/bin/phpunit -d memory_limit=512m --coverage-html=_coverage --coverage-text |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,24 @@ And include extension.neon in your project's PHPStan config | |
includes: | ||
- vendor/timeweb/phpstan-enum/extension.neon | ||
``` | ||
|
||
## Install for Local Development | ||
|
||
### With docker | ||
|
||
```bash | ||
git clone [email protected]:timeweb/phpstan-enum.git | ||
cd phpstan-enum | ||
make docker-build | ||
make install | ||
make phpunit | ||
``` | ||
|
||
### Without docker (localy installed actual version of php, composer, etc) | ||
|
||
```bash | ||
git clone [email protected]:timeweb/phpstan-enum.git | ||
cd phpstan-enum | ||
make install | ||
make phpunit | ||
``` |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
mkdir -p "$HOME/.composer/cache/" | ||
|
||
test -t 1 && USE_TTY="--tty" | ||
|
||
docker run --rm --interactive ${USE_TTY} \ | ||
--user $UID:$UID \ | ||
--volume "$PWD":/app \ | ||
--volume "$HOME/.composer":/tmp/.composer \ | ||
--env COMPOSER_HOME=/tmp/.composer \ | ||
timeweb/phpstan-enum composer "$@" |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
test -t 1 && USE_TTY="--tty" | ||
|
||
docker run --rm --init --interactive ${USE_TTY} \ | ||
--user $UID:$UID \ | ||
--volume "$PWD:/app" \ | ||
timeweb/phpstan-enum php "$@" |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
test -t 1 && USE_TTY="--tty" | ||
|
||
docker run --rm --init --interactive ${USE_TTY} \ | ||
--user $UID:$UID \ | ||
--volume "$PWD:/app" \ | ||
timeweb/phpstan-enum phpdbg "$@" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.