-
Notifications
You must be signed in to change notification settings - Fork 4
/
.travis.yml
42 lines (36 loc) · 1.24 KB
/
.travis.yml
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
40
41
42
sudo: required
dist: trusty
language: php
services:
- docker
matrix:
fast_finish: true
include:
- env:
- PHP_CS_FIXER_VERSION=2.13.0
- IS_LATEST=1
before_script:
- docker build --rm --tag herloct/php-cs-fixer:$PHP_CS_FIXER_VERSION-$TRAVIS_BRANCH .
- docker run --rm herloct/php-cs-fixer:$PHP_CS_FIXER_VERSION-$TRAVIS_BRANCH
script:
- cd tests
- docker run --rm
--volume $(pwd):/project
herloct/php-cs-fixer:$PHP_CS_FIXER_VERSION-$TRAVIS_BRANCH fix Sample.php
- ls -la .
- if [[ ! -f "Sample.php" ]]; then exit 1; fi
- cat Sample.php
- cmp Sample.after Sample.php
after_success:
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin;
- if [[ $TRAVIS_BRANCH ]] && [[ -z $TRAVIS_TAG ]]; then
docker push herloct/php-cs-fixer:$PHP_CS_FIXER_VERSION-$TRAVIS_BRANCH;
fi
- if [[ $TRAVIS_TAG ]]; then
docker tag herloct/php-cs-fixer:$PHP_CS_FIXER_VERSION-$TRAVIS_BRANCH herloct/php-cs-fixer:$PHP_CS_FIXER_VERSION;
docker push herloct/php-cs-fixer:$PHP_CS_FIXER_VERSION;
fi
- if [[ $TRAVIS_TAG ]] && [[ $IS_LATEST == 1 ]]; then
docker tag herloct/php-cs-fixer:$PHP_CS_FIXER_VERSION herloct/php-cs-fixer:latest;
docker push herloct/php-cs-fixer:latest;
fi