forked from opensalt/opensalt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
98 lines (78 loc) · 3.29 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
88
89
90
91
92
93
94
95
96
97
98
branches:
only:
- master
- develop
- /^[0-9].*$/
sudo: required
env:
global:
- COMMIT=${TRAVIS_COMMIT::8}
- DOCKER_COMPOSE_VERSION=1.24.1
- FIREBASE_PREFIX=${FIREBASE_PREFIX:-travis}-${TRAVIS_BUILD_NUMBER}
dist: xenial
language: minimal
cache:
directories:
- vendor
services:
- docker
addons:
apt:
sources:
- docker-xenial
packages:
- docker-ce
#apt addons:
before_install:
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin/
- docker -v
- docker-compose -v
# Create the application artifacts
install:
- ln -s docker-compose.test.yml docker/docker-compose.yml
- ln -s .env.test docker/.env
- ln -s docker/.env ./.env
- echo ${TRAVIS_BUILD_NUMBER} > BUILD_NUMBER
- echo $(date -u +%Y%m%d.%H%M).${COMMIT} > BUILD_MD
- echo $(cat VERSION).$(cat BUILD_NUMBER)+$(cat BUILD_MD) > public/version.txt
- ./bin/build.sh
# Create docker image with the running code
before_script:
- mkdir public/attachments/
- chmod 777 public/attachments/
- ./docker/app/build.sh
- docker-compose -f docker/docker-compose.yml up -d
- docker-compose -f docker/docker-compose.yml exec phpfpm dockerize -timeout 60s -wait tcp://db:3306 && sleep 5
# Run the tests
script:
- ./bin/console --env=prod doctrine:migrations:migrate -q --no-interaction
- ./bin/console --env=prod import:generic-csv tests/_data/test_items.csv
- echo 'Running tests...' && echo -en 'travis_fold:start:run.tests\\r'
- ./bin/run-tests ${RUN_TEST_ARGS:-"--steps -x duplicate -x skip -x skip-firefox"}
- echo -en 'travis_fold:end:run.tests\\r'
# - 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then bash ./travis/build_pull_request; fi'
# - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash ./travis/build_normal; fi'
#before_cache:
#$TRAVIS_TEST_RESULT has build result 0==success
after_success:
- ./bin/console --env=prod firebase:clear
- if [ "$OPENSALT_HEROKU_DEPLOY" != "true" ]; then ./ci/travis/push_app.sh; fi
# - if [ "$TRAVIS_BRANCH" == "master" ]; then /bin/true; fi
after_failure:
- echo "Tests FAILED"
- ./bin/console --env=prod firebase:clear
#- echo 'PHP errors...' && echo -en 'travis_fold:start:log.errors\\r'
#- ./ci/travis/send_errors.sh
#- echo -en 'travis_fold:end:log.errors\\r'
#before_deploy:
#deploy:
# skip_cleanup: true
#after_deploy:
after_script:
- docker-compose -f docker/docker-compose.yml -f docker/docker-compose.tools.yml down -v
notifications:
slack:
secure: RNpMIVa23IbyLyIc4g5C0Hgk7h9zN5H8VNbTTNkpDTrkvpg77zjrcbkMLUaX2C1+4YYUjwiCrwD/T26icbTft3cnSaUJlRX9vUnsVApnnXbY5Y3saHDPvqSAJodJLB2dXKJ8xqKaEV5N780EbxU5dOwy52A+4TEQSuoS6jWDChnqdJLqNocMGE5w+6vHovyuE1/Svjmg7PJmsSOsMk0Prfo9OGFukTNgWuounssmDp9nM3kp9ON64opO9umUoWLpLAWppr1W3Rkj4h1Hq4KKeZ7gkyR2CtpxyhQuAa9xfZk4yIKJp0SS8Rb+rhF5bal9nfmNC1OgfhzskpUpMgbonUaSPytrhy2L4j8S81QyHf53c7+y0RkFvk/1qq4raCbwjXQ35lfmBJvnHUB35JXvBo0G9+mgJJqLKp+bXwyHjOy46aP7UxN3ovL7qFjINclfSihCrrLPJk39LoMQuNHHaVzKVrC+DSfWirD3rzra9WbahJovKdemVYvYFcWi09AGZXC6YWHe3UnnbmWrCaTlU0iwH4s+ikhrAewdfjbagmXYSzl4nslxEegkmBpCRrqYAnRJxqY5dnr2IlUyXAt5Hn8AsmEzIMxNsnYh9Mbyt++mlk1Lcb+a5DtpxvM5aHKTK1pK1f75kEUMjOh4LaEIw6LAE8tBV6AEBi37KoZFJIE=