This repository has been archived by the owner on Jan 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
64 lines (59 loc) · 2.63 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
language: go
dist: trusty
sudo: true
env:
- TRAVIS_NODE_VERSION="stable"
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- export PATH=$HOME/bin:$PATH
- sh -e /etc/init.d/xvfb start
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
install:
- if [ ${BRANCH:0:3} = "be/" ]; then
curl -Lo protoc.zip https://github.com/google/protobuf/releases/download/v3.0.0/protoc-3.0.0-linux-x86_64.zip;
unzip protoc.zip -d $HOME;
go get -u github.com/golang/protobuf/{proto,protoc-gen-go};
elif [ ${BRANCH:0:3} = "fe/" ]; then
sudo apt-get update;
sudo apt-get install -y libappindicator1 fonts-liberation;
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb;
sudo dpkg -i google-chrome*.deb;
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 -g @angular/cli karma;
cd frontend && npm install && cd ..;
elif [ ${BRANCH:0:4} = "doc/" ]; then
echo "Docs - nothing to do.";
else
curl -Lo protoc.zip https://github.com/google/protobuf/releases/download/v3.0.0/protoc-3.0.0-linux-x86_64.zip;
unzip protoc.zip -d $HOME;
go get -u github.com/golang/protobuf/{proto,protoc-gen-go};
sudo apt-get update;
sudo apt-get install -y libappindicator1 fonts-liberation;
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb;
sudo dpkg -i google-chrome*.deb;
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 -g @angular/cli karma;
cd frontend && npm install && cd ..;
fi
before_script:
- if [ ${BRANCH:0:3} = "be/" ]; then
make proto;
elif [ ${BRANCH:0:3} = "fe/" ]; then
cd frontend && ng build && cd ..;
elif [ ${BRANCH:0:4} = "doc/" ]; then
echo "Docs - nothing to do.";
else
make proto && cd frontend && ng build && cd ..;
fi
script:
# Build frontend or backend independently based on branch name
- if [ ${BRANCH:0:3} = "be/" ]; then
make proto && make be;
elif [ ${BRANCH:0:3} = "fe/" ]; then
make fe-test;
elif [ ${BRANCH:0:4} = "doc/" ]; then
echo "Docs - nothing to do.";
else
make;
fi