-
Notifications
You must be signed in to change notification settings - Fork 27
/
.travis.yml
81 lines (72 loc) · 2.28 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
branches:
only:
- master
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
language: go
services:
- docker
go:
- "1.12.x"
before_install:
- . $HOME/.nvm/nvm.sh
- nvm install 8
- nvm use 8
- npm install -g yarn
install:
- make dependencies
stages:
- name: validate and build
- name: release to github
if: tag IS present
- name: push to dockerhub
if: tag IS present
jobs:
include:
# validate and build
- stage: validate and build
name: 'Test coverage & linters'
script:
- make test
- make packages
- make lint
- make coverage
- make validate-commit
- name: 'Integration tests'
script:
- docker run -d --name bblfshd --privileged --volume $HOME/bblfsh-drivers:/var/lib/bblfshd -p "9432:9432" bblfsh/bblfshd
- sleep 5
- docker exec -it bblfshd bblfshctl driver install --force go docker://bblfsh/go-driver:latest
- docker exec -it bblfshd bblfshctl driver install --force javascript docker://bblfsh/javascript-driver:latest
- mkdir $HOME/repos
- git clone https://github.com/src-d/gitbase-web.git $HOME/repos/gitbase-web
- docker run -d --name gitbase -p "3367:3306" -e "BBLFSH_ENDPOINT=bblfshd:9432" --volume $HOME/repos:/opt/repos --link bblfshd srcd/gitbase:v0.19.0
- sleep 15
- GITBASEPG_DB_CONNECTION='root@tcp(localhost:3367)/none' GITBASEPG_INTEGRATION_TESTS=true make test
- name: 'Footer test'
script:
- PKG_OS=linux make build
- make docker-build
- export FOOTER_HTML='<div class="custom-base64-html"></div>'
- export FOOTER_HTML_BASE64=`echo -n $FOOTER_HTML | base64`
- docker run --rm -d --publish 8080:8080 --env GITBASEPG_FOOTER_HTML=$FOOTER_HTML_BASE64 srcd/gitbase-web:$(make version)
- sleep 5
- curl http://127.0.0.1:8080 | grep "$FOOTER_HTML"
# release to github
- stage: release to github
name: 'Release to GitHub'
script:
- make packages
deploy:
provider: releases
api_key: $GITHUB_TOKEN
file_glob: true
file: build/*.tar.gz
skip_cleanup: true
on:
all_branches: true
cache:
directories:
- $HOME/bblfsh-drivers/images
before_cache:
# make bblfsh images readable
- sudo chmod -R 777 $HOME/bblfsh-drivers/images