-
Notifications
You must be signed in to change notification settings - Fork 47
/
.travis.yml
81 lines (81 loc) · 3.45 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
language: php
dist: trusty
sudo: required
cache:
directories:
- vendor/
php:
- 7.0
services:
- mongodb
- docker
addons:
apt:
packages:
- nginx
- uuid-runtime
hosts:
- localhost
- gandalf.dev
env:
global:
- DOCKER_HUB_ACCOUNT=nebo15
- MAIN_BRANCHES="master develop staging"
- RELEASE_BRANCH="master"
- TZ=Europe/Kiev
- secure: "UyUiulHW4doki7+bb9sntgxix9ExPOPkqJ1vCVHCbss+vpOWt5iuoAGn7B4T1mAePWmoMbsS4v410z+6K1xEhIfZ0DLxdEOubj6+ts7rgQjwnhMXu2OChq1eNiO2QCK2A2sA4XSJfrSts5npjMVX8WvciuZvfXx3cevvRFaIisynF38wbGyDLa+N/d9pBHi+2zo37UGN0zsN5sTUATV4F/ijvdNhI7Gflbwb25+Ngm/vkBjoUrlYslxp+y8obQBgMM9RMkX+5dUyG/1Mpvjdl3MpYSF7SyDs+g0gbGbGbT1xskQf0q7VkXMgBbJPsrIfeZURvqpdi1atzV6xgg6MH6D6I3j2VfxcuK0wuNxkKz4D2i9SyCky/w9tLE4ncta3hkW3pG+tedherqhdwsetSljv00y+dXCnprX/XLqdFnJ+VV/lIv1F7pRRCCaiOghBSg/Nlvc9Y1po6Kcvb1nmZL+CZwLDR2JXreJFzKt5CmBcd9tsb++3yWWik8LMfY4PHw0W/p8ZwgeQFQQroD63sldK4Of0qzslxvlMv83r9h8AMbsI4LXYll66W/0TZeTXNBEuRrx0MgW6NBjGJtoyMNr3wtNmL481KfI2s2iwbFPy2Sk4uG8GzbM91aEFfKzCP5cE2dlL0+CEAcOWGeUidHMO52KWkOCEiTxKFOIymSg="
- secure: "b2EZd81ufar0RNzTVpaKq34Tkuq0lB14A6K0LpqHtUF3hj4jcM9YctFoo8C8ijfCbyWYgPobF6jZDa+gOoguxQbIkRG+9RhvG8Twi5pOb0D9HmyggUmq0vLLbabC5cjjJRgE7AKlNym/Cx8jUine4yc6x7Yi0dCb/GUEirMgyBw3fLwci6GPZA6ESjUvnDFIkFwTTTtN9uig6wM4WzPfO0jdlkcBAimncaGgOmQS4COPZKFcLPttc+vOxlZhF4EqmgpLL6awR09SKJaThsB9hpPR6CJCrU+jlLiec7dpzfrzGxmr1s3qRr0yMZgMEnL+k/g/DUcx5rcJyXfpHbBxKscAENc41V7nooi+9BD5jSLJdIqY9tvsRnCa0XwtiJj1AjLEAcCcBVRxWoHM2sB5sTl9s7V76YNT8E6aF5B1BtwgBeIg56+ia3iSFMZbfir21k5uknU24pKe/Sj+sn4LIFDAj2e0sJdh9dAI5PeNO6ht9h+fMobe7PqC5i4QfRMYm4PDNO57lNF6zJ1VUkPm8ykZwqR548R5zYwW0Lk3pdRawRRMn/NgzKdE66Eu2KBMTmt5CwiK1NpqbsCSYbT1ByqDNbDubGz4SxobHnRc6mFIf48oZ914dpxU8jQvCDjbxclMgReZ8xbgHMAUB+HNX4fnMUZq5LKnjw+Owf+l5aE="
before_script:
# Our Nginx config uses /www/gandalf.api path. Preserve it on CI
- sudo mkdir -p /www
- sudo ln -s $PWD /www/gandalf.api
- sudo adduser www-data travis
# Install and configure nginx
- ./.travis/scripts/install_nginx.sh
# Install and configure PHP
- ./.travis/scripts/install_php.sh
# Disable XDebug
- phpenv config-rm xdebug.ini
# Configure file paths and application environment
- touch storage/logs/lumen.log
- sudo chmod 777 -Rf storage/ public/dump/
- cp ./.env.example ./.env
# Install dependencies
- composer install --prefer-source
# Start PHP-FPM
- sudo ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
# Restart nginx
- sudo service nginx restart
script:
# Increment version
- ./bin/version-increment.sh
# Run tests
- vendor/bin/codecept run
- vendor/bin/phpcs ./app --standard=PSR2 --warning-severity=0
# Run Docker container
- sudo ./bin/build.sh
- sudo ./bin/start.sh
- sleep 5
- docker ps
- RUNNING_CONTAINERS=`docker ps | wc -l`;
- if [ "${RUNNING_CONTAINERS//[[:space:]]/}" == "1" ]; then echo "[E] Container is not started!" && false; fi;
# Send request to the container
- curl http://gandalf-docker.dev:8080/ -v
- docker logs gandalf.api --details --since 5h
after_failure:
- ls -l /etc/nginx
- ls -l /etc/nginx/sites-enabled
- echo $PWD
- ls -l ./
- ls -l ../
- ls -l /www
- cat /etc/nginx/sites-enabled/*
- cat /etc/nginx/nginx.conf
- cat /var/log/www/*.log;
- cat /var/log/php-fpm.log;
- cat $PWD/storage/logs/lumen.log;
- cat $PWD/tests/_output/*
- docker logs gandalf.api --details --since 5h
after_success:
# Submit Docker container to Docker Hub and create GitHub Release by pushing tag with a changelog
- ./bin/push.sh