forked from oaeproject/3akai-ux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
112 lines (90 loc) · 3.8 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
language: node_js
dist: precise
node_js:
- "6.11.1"
branches:
only:
- master
env:
global:
- secure: Amuv0dlhrdLdzoFN6WlOKETpYY5FdwtqroaFuVh1Gt6l01cPgOwDxR775xN1SQhv/3FlaxuwS8Zm+cMK/Q8QSPRgdwUiRDV0BcD603aOj9HxT06/yNmjSj6bClIR9DTfc2NhwdG5cNMur54Dvrtk6ZZet2GYJoEsfFtE0v9Gq9M=
- secure: DHt20YWVkb6wOdVcsBJ/zW2IyZVdVLBCiMlAhqdIREkZ5IpV5v9BV4/RzykiOQilDBPhqZp1Dd5XGDaNXqXNvnibO+3NxvY3VQX0o/uFs2Ig1AGzf1iKf3GyfObLtN5r8I58todT3jjO1vNwHQM3xHWwFa9qAeOclM/tyKdkJks=
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 PPA repos for miscellaneous dependencies
- echo 'yes' | sudo add-apt-repository ppa:oae/deps
- sudo apt-get update
# Install cassandra 1.2 manually
- sudo service cassandra stop
- sudo apt-get install -y -o Dpkg::Options::=--force-confnew cassandra=2.0.8
- sudo service cassandra start
- sudo service cassandra status
# Install nginx
- sudo apt-get install nginx=1.7.6-1+precise1
# Turn off unneeded services to free some memory
- sudo service mysql stop
- sudo service memcached stop
- sudo service postgresql stop
# Install Hilary deps
- sudo apt-get install -qq graphicsmagick libreoffice pdftk chrpath pdf2htmlex
- npm install -g grunt-cli
# 3akai-ux dependencies
- npm install -g casperjs
# Show the CasperJS and PhantomJS version for debugging purposes
- casperjs --version
- phantomjs --version
# Install etherpad-lite
- sudo apt-get install etherpad-lite
- cd /opt/etherpad
- 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 to talk to Cassandra
- "sed -i 's/dbType\" : \"dirty/dbType\" : \"cassandra/g' settings.json"
- "sed -i 's/\"filename\" : \"var\\/dirty.db\"/\"hosts\": [ \"localhost:9160\" ], \"keyspace\": \"etherpad\", \"cfName\": \"Etherpad\", \"user\": \"\", \"pass\": \"\", \"timeout\": 3000, \"replication\": \"1\", \"strategyClass\": \"SimpleStrategy\", \"cqlVersion\": \"2.0.0\"/g' settings.json"
- "sed -i 's/defaultPadText\" : \".*\"/defaultPadText\" : \"\"/g' settings.json"
- echo "13SirapH8t3kxUh5T5aqWXhXahMzoZRA" > APIKEY.txt
- node src/node/server.js &> /dev/null &
# Install Hilary
- cd ~/build/oaeproject
- git clone --depth 1 --branch master git://github.com/oaeproject/Hilary.git ./Hilary
- cd ./Hilary
- npm install --production
# Configure 3akai-ux/nginx
- cd ~/build/oaeproject/3akai-ux
- npm install
- "echo '{\"NGINX_USER\": \"root\",\"NGINX_GROUP\": \"root\",\"NGINX_HOSTNAME\": \"admin.oae.com\",\"UX_HOME\": \"/home/travis/build/oaeproject/3akai-ux\",\"LOCAL_FILE_STORAGE_DIRECTORY\": \"/home/travis/build/oaeproject/files\"}' > nginx/nginx.json"
- grunt configNginx
- sudo cp ./target/optimized/nginx/nginx.conf /etc/nginx/nginx.conf
- sudo mkdir /usr/share/nginx/logs
- sudo service nginx restart
addons:
hosts:
- test.oae.com
- admin.oae.com
services:
- elasticsearch
- rabbitmq
- redis-server
script:
- /bin/true
after_success:
# Package and upload to Amazon S3
- etc/scripts/travis-upload.sh
after_failure:
# Compress the logs and upload them to Amazon S3
- cd ../Hilary
- gzip tests.log
- bin/upload_logs
notifications:
email:
irc:
channels:
- "irc.freenode.org#oae"
skip_join: true