forked from WoWAnalyzer/WoWAnalyzer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
39 lines (39 loc) · 1013 Bytes
/
.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
language: node_js
services:
- docker
node_js:
- 8.2.1
cache:
directories:
- node_modules
- server/node_modules
env:
- NODE_ENV=production
install:
- npm install
- cd server && npm install --dev && cd ..
script:
- npm test
- npm run build
- cd server && npm run build && cd ..
after_success:
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
cd server;
echo "The server has already been built so we no longer need the devDependencies";
npm prune --production;
cd ..;
export REPO=martijnhols/wowanalyzer;
export BRANCH=$(
if [ "$TRAVIS_BRANCH" == "master" ]; then
echo "latest";
else
echo $TRAVIS_BRANCH;
fi | sed -r 's/\//-/g'
);
echo "#docker build";
docker build --tag $REPO:$BRANCH --file Dockerfile.package .;
echo "#docker login";
docker login --username="$DOCKER_USERNAME" --password="$DOCKER_PASSWORD";
echo "#docker push";
docker push $REPO:$BRANCH;
fi