forked from oaeproject/Hilary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
125 lines (103 loc) · 4.86 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
language: node_js
node_js:
- "0.10.30"
branches:
only:
- master
env:
global:
- OAE_TEST_INTEGRATION=false
- secure: T23GAZQqZsNKK7OXEr0d3UwFoE/8hAgPOF5jgdTAJTHI6Jq+OjOv9jt+QvuKxpfqt3/yz+JzztRJAw12CD1BHej4L6NSXIalUfnn2EF93otFRSTRBQ2uzofBJ+MtUQqyCRG7Ha8sjEWoWc/QkdZbFGTaJpQpUuBt1oSabT0D3zA=
- secure: T1wEYmk7AhKxIGtDbb12ERT18sNb/92vL1VBo42Q4JMd4ww/Z3E7su5T3IsVY3cjaE2X7oKNVBWx9TWvkJJnHk5UiN3SmKiIGcFNKOvp6ha9BW0JyVAk5lPRh5poq33GrCvkZT3YKX7AgI/+7TutrbYVE/o5Bs599rF+8l8dSkk=
before_install:
# Add DataStax apt repo for Cassandra
- curl -L http://debian.datastax.com/debian/repo_key | sudo apt-key add -
- echo "deb http://debian.datastax.com/community stable main" | sudo tee -a /etc/apt/sources.list.d/dsc.sources.list
# Add ElasticSearch apt repo
- wget -qO - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | sudo apt-key add -
- echo "deb http://packages.elasticsearch.org/elasticsearch/1.5/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch.sources.list
# Add PPA repos for miscellaneous dependencies
- echo 'yes' | sudo add-apt-repository ppa:oae/deps
- sudo apt-get update
# Install cassandra 2 manually
- sudo service cassandra stop
- sudo apt-get install -y -o Dpkg::Options::=--force-confnew cassandra=2.0.8
- "sudo sed -i '1iMAX_HEAP_SIZE=512M\\nHEAP_NEWSIZE=48M\\n' /etc/cassandra/cassandra-env.sh"
- "sudo sed -i 's/rpc_server_type: sync/rpc_server_type: hsha/g' /etc/cassandra/cassandra.yaml"
- "sudo sed -i 's/key_cache_size_in_mb:/key_cache_size_in_mb: 0/g' /etc/cassandra/cassandra.yaml"
- sudo service cassandra stop
# Give Cassandra some time to shut down
- sleep 5
- sudo service cassandra start
- sleep 5
- sudo service cassandra status
# Install elasticsearch 1.5.2 manually
- sudo service elasticsearch stop
- sudo apt-get install -y --force-yes -o Dpkg::Options::=--force-confnew elasticsearch=1.5.2
- sudo service elasticsearch start
# Turn off unneeded services to free some memory
- sudo service mysql stop
- sudo service memcached stop
- sudo service postgresql stop
# Do not let Redis save to disk
- "sudo sed -i 's/save 900 1/#save 900 1/g' /etc/redis/redis.conf"
- "sudo sed -i 's/save 300 10/#save 300 10/g' /etc/redis/redis.conf"
- "sudo sed -i 's/save 60 10000/#save 60 10000/g' /etc/redis/redis.conf"
- sudo service redis-server restart
# We must ensure phantomjs is not available so the travis build will include it in node_modules when deploying
- sudo rm -rf /usr/local/phantomjs
# Install Hilary deps
- sudo apt-get install -qq graphicsmagick libreoffice chrpath pdf2htmlex poppler-utils
- npm install -g grunt-cli
- git clone --depth 1 --branch master git://github.com/oaeproject/3akai-ux.git ../3akai-ux
# Install etherpad
- cd /usr/src
- sudo wget https://s3.amazonaws.com/oae-releases/etherpad/1.5/etherpad-1.5.6_node-0.10.17.tar.gz
- sudo mkdir /opt/etherpad
- cd /opt/etherpad
- sudo tar -zxvf /usr/src/etherpad-1.5.6_node-0.10.17.tar.gz > /dev/null
- sudo touch APIKEY.txt
- sudo chmod -R 777 .
# Create a keyspace that we can start etherpad up into. There is a chicken-and-egg problem by having unit tests drop/create and have
# etherpad be available, so we just create a separate keyspace for it
- "echo \"CREATE KEYSPACE etherpad WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};\" > /tmp/.create_etherpad_keyspace.cql3"
- cqlsh -f /tmp/.create_etherpad_keyspace.cql3
# Configure etherpad
- "sed -i 's/dbType\" : \"dirty/dbType\" : \"cassandra/g' settings.json"
- "sed -i 's/\"filename\" : \"var\\/dirty.db\"/\"clientOptions\": {\"keyspace\": \"etherpad\", \"contactPoints\": [\"localhost\"]},\"columnFamily\": \"Etherpad\"/g' settings.json"
- "sed -i 's/defaultPadText\" : \".*\"/defaultPadText\" : \"\"/g' settings.json"
- echo "13SirapH8t3kxUh5T5aqWXhXahMzoZRA" > APIKEY.txt
# Start etherpad
- node node_modules/ep_etherpad-lite/node/server.js &> /dev/null &
# Position ourselves to start the test in "script" phase
- cd ~/build/oaeproject/Hilary
# Enable preview processing
- printf "\n\nconfig.previews.enabled = true;" >> config.js
- printf "\nconfig.previews.office.binary = '/usr/bin/soffice';" >> config.js
- printf "\nconfig.previews.pdf2htmlEX.binary = '/usr/bin/pdf2htmlEX';" >> config.js
- printf "\nconfig.previews.pdftotext.binary = '/usr/bin/pdftotext';" >> config.js
services:
- rabbitmq
- redis-server
script:
- grunt test-coverage-coveralls
after_success:
- ps aux --sort -rss | head
- top -n1 -b
- df -h
# Package and upload to Amazon S3
- etc/scripts/travis-upload.sh
after_failure:
- ps aux --sort -rss | head
- top -n1 -b
- df -h
# Compress the logs and upload them to Amazon S3
- gzip tests.log
- bin/upload_logs
notifications:
email:
irc:
channels:
- "irc.freenode.org#oae"
skip_join: true