This repository has been archived by the owner on Nov 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
87 lines (75 loc) · 3.69 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
branches:
only:
- master
- docker-build
dist: trusty
sudo: required
services:
- docker
language: php
matrix:
fast_finish: true
include:
- php: '7'
env:
- PHP_VERSION=7
- DB_CONNECTION=mysql
- DB_HOST=mariadb
- DB_USERNAME=root
- php: '7'
env:
- PHP_VERSION=7
- DB_CONNECTION=pgsql
- DB_HOST=postgres
- DB_USERNAME=postgres
- php: '5.6'
env:
- PHP_VERSION=5
- DB_CONNECTION=mysql
- DB_HOST=mariadb
- DB_USERNAME=root
- php: '5.6'
env:
- PHP_VERSION=5
- DB_CONNECTION=pgsql
- DB_HOST=postgres
- DB_USERNAME=postgres
cache:
directories:
- ./node_modules
- ./vendor
before_install:
- curl -L https://github.com/docker/compose/releases/download/1.8.1/docker-compose-`uname -s`-`uname -m` > docker-compose; chmod +x docker-compose; true
- sudo mv docker-compose /usr/local/bin/
- pwd && docker -v && docker info && docker-compose -v
install:
- chmod -R 0777 ./storage/logs
# - export PR=https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST
# - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo `curl -s $PR | jq -r .head.ref`; fi)
# - echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH"
- if [[ $TRAVIS_TAG == 'docker-build' ]]; then docker build -qf storage/build/scripts/nginx/Dockerfile -t audithsoftworks/basis:nginx .; else docker pull audithsoftworks/basis:nginx; fi;
- if [[ $TRAVIS_TAG == 'docker-build' && $PHP_VERSION == '5' ]]; then docker build -qf storage/build/scripts/php_5.6/Dockerfile -t audithsoftworks/basis:php_5.6 .; fi;
if [[ $TRAVIS_TAG == 'docker-build' && $PHP_VERSION == '7' ]]; then docker build -qf storage/build/scripts/php_7/Dockerfile -t audithsoftworks/basis:php_7 .; fi;
- if [[ $TRAVIS_TAG == 'docker-build' && $PHP_VERSION == '5' ]]; then docker build -qf storage/build/scripts/php_5.6-fpm/Dockerfile -t audithsoftworks/basis:php_5.6-fpm .; fi;
if [[ $TRAVIS_TAG == 'docker-build' && $PHP_VERSION == '7' ]]; then docker build -qf storage/build/scripts/php_7-fpm/Dockerfile -t audithsoftworks/basis:php_7-fpm .; fi;
- if [[ $TRAVIS_TAG != 'docker-build' && $PHP_VERSION == '5' ]]; then docker pull audithsoftworks/basis:php_5.6; fi;
if [[ $TRAVIS_TAG != 'docker-build' && $PHP_VERSION == '7' ]]; then docker pull audithsoftworks/basis:php_7; fi;
- if [[ $TRAVIS_TAG != 'docker-build' && $PHP_VERSION == '5' ]]; then docker pull audithsoftworks/basis:php_5.6-fpm; fi;
if [[ $TRAVIS_TAG != 'docker-build' && $PHP_VERSION == '7' ]]; then docker pull audithsoftworks/basis:php_7-fpm; fi;
- docker-compose up -d php${PHP_VERSION}-cli;
- docker images;
- docker-compose ps;
- echo $(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' basis_nginxForPhp${PHP_VERSION}_1) basis.audith.org | sudo tee -a /etc/hosts;
- docker exec basis_php${PHP_VERSION}-cli_1 /bin/bash -c "echo $(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' basis_nginxForPhp${PHP_VERSION}_1) basis.audith.org | sudo tee -a /etc/hosts";
before_script:
- chmod +x ./storage/build/scripts/ci/build.sh;
script:
- ./storage/build/scripts/ci/build.sh;
after_script:
- docker exec basis_php${PHP_VERSION}-cli_1 /bin/bash -c "pkill sc";
- if [[ $PHP_VERSION == 7 && $DB_CONNECTION == 'mysql' ]]; then wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover ./storage/coverage/coverage-clover-merged.xml; fi
notifications:
hipchat: [email protected]
slack:
rooms:
- audith:S5sZNDhaq1BnqBMNk4UunAnz#github-ci-logs