-
Notifications
You must be signed in to change notification settings - Fork 28
/
.travis.yml
97 lines (79 loc) · 2.46 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
language: php
addons:
ssh_known_hosts: pece.revax.com.br
apt:
packages:
- php5.6-cgi
- php5.6-mysql
- php7.4-cgi
- php7.4-mysql
- php8.1-cgi
- php8.1-mysql
php:
- 5.6
- 7.4
- 8.1
mysql:
database: pece
username: root
encoding: utf8
install:
# install drush
- pear channel-discover pear.drush.org
- pear install drush/drush-5.8.0
- phpenv rehash
env:
- TRAVIS_NODE_VERSION="4"
services:
- docker
# branches:
# - dev
# Production Env Setup
before_install:
- docker-compose run production
install:
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
- npm install
# install drush
- pear channel-discover pear.drush.org
- pear install drush/drush-5.8.0
- phpenv rehash
before_deploy:
- openssl aes-256-cbc -K $encrypted_33c1172ef7ff_key -iv $encrypted_33c1172ef7ff_iv -in deploy-travisci.enc -out /tmp/deploy_rsa -d
- eval "$(ssh-agent -s)"
- chmod 600 /tmp/deploy_rsa
- ssh-add /tmp/deploy_rsa
# E2E Tests Setup
before_script:
# Setup /tmp directory for tests
- mkdir /tmp/pece
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- nohup bash -c "./node_modules/protractor/bin/webdriver-manager start 2>&1 &"
- sleep 3 # give xvfb some time to start
- nvm use default
# navigate out of module directory to prevent blown stack by recursive module lookup
- cd ../..
# create new site, stubbing sendmail path with true to prevent delivery errors and manually resolving drush path
- mysql -e 'create database pece'
- php -d sendmail_path=`which true` `pear config-get php_dir`/drush/drush.php --yes core-quick-drupal --profile=pece --no-server --db-url=mysql://root:@127.0.0.1/pece --enable=simpletest pece
# reference and enable travis_ci_drupal_module_example in build site
- ln -s $(readlink -e $(cd -)) pece/drupal/sites/all/modules
- cd build
- drush --yes pm-enable pece_core pece_demo
# start a web server on port 8080, run in the background
- drush runserver 127.0.0.1:8080 &
script:
- echo "Script Running..."
- drush test-run 'Pece, PeceWeb' --uri=http://127.0.0.1:8080
- cd profiles/pece/modules
- phpunit --exclude-group ExternalInterfaces .
- npm test
deploy:
- provider: script
skip_cleanup: true
script: ./deploy-dev.sh
on:
branch: dev
after_success:
- echo "Deployed Successfully! \o/"