-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
55 lines (45 loc) · 1.25 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
language: go
go:
- 1.12.x
notifications:
email: false
addons:
ssh_known_hosts: 202.120.40.8:30710
services:
- docker
env:
global:
- JJ_MARIADBUSER=root
- JJ_MARIADBPWD=123456
- JJ_MONGODBUSER=root
- JJ_MONGODBPWD=123456
before_install:
- sudo /etc/init.d/mysql stop
- docker pull mariadb
- docker run -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 -e MYSQL_DATABASE=sjtujj mariadb
- docker pull mongo
- docker run -d -p 27017:27017 -e MONGO_INITDB_ROOT_USERNAME=root -e MONGO_INITDB_ROOT_PASSWORD=123456 mongo
install:
- wget https://releases.hashicorp.com/consul/1.5.2/consul_1.5.2_linux_amd64.zip
- unzip consul_1.5.2_linux_amd64.zip
- sudo mv consul /usr/local/bin/
- go get github.com/mattn/goveralls github.com/modocache/gover
- export GOFLAGS=-mod=vendor
- export GO111MODULE=on
before_script:
- consul agent -bootstrap -server -bind=127.0.0.1 -data-dir=./data/ 2>&1 1>consul.log &
- sleep 3
- cd backend
- consul kv import @consul.json
script:
- make test
- gover
- goveralls -coverprofile=gover.coverprofile -service=travis-ci -repotoken $COVERALLS_TOKEN
- cp config_deploy.json config.json
- make docker
deploy:
provider: script
script: make deploy
on:
branch: master
tags: true