-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path.travis.yml
More file actions
39 lines (34 loc) · 1.13 KB
/
.travis.yml
File metadata and controls
39 lines (34 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
sudo: required
dist: trusty
services:
- docker
matrix:
fast_finish: true
include:
- env:
- PHPCS_VERSION=3.3.2
- IS_LATEST=1
before_script:
- docker build --rm --tag herloct/phpcs:$PHPCS_VERSION-$TRAVIS_BRANCH .
- docker run --rm herloct/phpcs:$PHPCS_VERSION-$TRAVIS_BRANCH
script:
- cd tests
- docker run --rm
--volume $(pwd):/project
herloct/phpcs:$PHPCS_VERSION-$TRAVIS_BRANCH --version
- docker run --rm
--volume $(pwd):/project
herloct/phpcs:$PHPCS_VERSION-$TRAVIS_BRANCH --standard=PSR1,PSR2 --report-file=report Sample.php || true
- if [[ ! -f "report" ]]; then exit 1; fi
- cat report
after_success:
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin;
- docker push herloct/phpcs:$PHPCS_VERSION-$TRAVIS_BRANCH;
- if [[ $TRAVIS_TAG ]]; then
docker tag herloct/phpcs:$PHPCS_VERSION-$TRAVIS_BRANCH herloct/phpcs:$PHPCS_VERSION;
docker push herloct/phpcs:$PHPCS_VERSION;
fi
- if [[ $TRAVIS_TAG ]] && [[ $IS_LATEST == 1 ]]; then
docker tag herloct/phpcs:$PHPCS_VERSION herloct/phpcs:latest;
docker push herloct/phpcs:latest;
fi