File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ sudo : required
2+ dist : trusty
3+
4+ services :
5+ - docker
6+
7+ matrix :
8+ fast_finish : true
9+ include :
10+ - env :
11+ - PHPCS_VERSION=2.9.0
12+ - IS_LATEST=1
13+
14+ before_script :
15+ - docker build --rm --tag herloct/phpcs:$PHPCS_VERSION-$TRAVIS_BRANCH .
16+ - docker run --rm herloct/phpcs:$PHPCS_VERSION-$TRAVIS_BRANCH
17+
18+ script :
19+ - cd tests
20+ - docker run --rm
21+ --volume $(pwd):/project
22+ herloct/phpcs:$PHPCS_VERSION-$TRAVIS_BRANCH --version
23+ - docker run --rm
24+ --volume $(pwd):/project
25+ herloct/phpcs:$PHPCS_VERSION-$TRAVIS_BRANCH --standard=PSR1,PSR2 --report-file=report Sample.php || true
26+ - if [[ ! -f "report" ]]; then exit 1; fi
27+ - cat report
28+
29+ after_success :
30+ - docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
31+ - docker push herloct/phpcs:$PHPCS_VERSION-$TRAVIS_BRANCH;
32+ - if [[ $TRAVIS_TAG ]]; then
33+ docker tag herloct/phpcs:$PHPCS_VERSION-$TRAVIS_BRANCH herloct/phpcs:$PHPCS_VERSION;
34+ docker push herloct/phpcs:$PHPCS_VERSION;
35+ fi
36+ - if [[ $TRAVIS_TAG ]] && [[ $IS_LATEST == 1 ]]; then
37+ docker tag herloct/phpcs:$PHPCS_VERSION herloct/phpcs:latest;
38+ docker push herloct/phpcs:latest;
39+ fi
Original file line number Diff line number Diff line change 1- FROM php:7.1.1 -alpine
1+ FROM php:7.1.5 -alpine
22
33MAINTAINER herloct <herloct@gmail.com>
44
5- ENV PHPCS_VERSION=2.8.1
5+ ENV PHPCS_VERSION=2.9.0
66
77RUN curl -L https://github.com/squizlabs/PHP_CodeSniffer/releases/download/$PHPCS_VERSION/phpcs.phar > /usr/local/bin/phpcs \
88 && chmod +x /usr/local/bin/phpcs \
Original file line number Diff line number Diff line change 1- [ ![ ] ( https://images.microbadger.com/badges/image/herloct/phpcs.svg )] ( http://microbadger.com/images/herloct/phpcs " Get your own image badge on microbadger.com ")
1+ [ ![ license] ( https://img.shields.io/github/license/herloct/docker-phpcs.svg )] ( )
2+ [ ![ Build Status] ( https://travis-ci.org/herloct/docker-phpcs.svg?branch=master )] ( https://travis-ci.org/herloct/docker-phpcs )
23
34## Supported tags and respective ` Dockerfile ` links
45
5- * [ ` 2.8.1 ` , ` latest ` ] ( https://github.com/herloct/docker-phpcs/blob/2.8.1/Dockerfile )
6+ * [ ` 2.9.0 ` , ` latest ` ] ( https://github.com/herloct/docker-phpcs/blob/2.9.0/Dockerfile )
7+ * [ ` 2.8.1 ` ] ( https://github.com/herloct/docker-phpcs/blob/2.8.1/Dockerfile )
68* [ ` 2.8.0 ` ] ( https://github.com/herloct/docker-phpcs/blob/2.8.0/Dockerfile )
79* [ ` 2.7.1 ` ] ( https://github.com/herloct/docker-phpcs/blob/2.7.1/Dockerfile )
810
@@ -19,7 +21,7 @@ Basic usage.
1921``` sh
2022docker run --rm \
2123 --volume /local/path:/project \
22- herloct/phpcs [< options> ]
24+ herloct/phpcs[:tag] [< options> ]
2325```
2426
2527For example, to check ` src ` directory against the PSR1 and PSR2 coding standard.
@@ -32,4 +34,4 @@ docker run --rm \
3234
3335## Volumes
3436
35- * ** /project** : Your PHP project directory.
37+ * ` /project ` : Your PHP project directory.
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ class Sample {
4+ public function doSomething () {
5+ //
6+ }
7+ }
You can’t perform that action at this time.
0 commit comments