1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-10 00:29:01 +02:00
kratos/.travis.yml

60 lines
1.9 KiB
YAML
Raw Normal View History

2019-02-01 09:57:43 +02:00
language: go
go:
- 1.12.x
2019-10-12 10:18:51 +02:00
- 1.13.x
2019-02-01 09:57:43 +02:00
2019-10-12 06:15:56 +02:00
services:
- docker
2019-02-01 09:57:43 +02:00
# Only clone the most recent commit.
git:
depth: 1
# Force-enable Go modules. This will be unnecessary when Go 1.12 lands.
env:
global:
- GO111MODULE=on
- REGION=sh
- ZONE=sh001
- DEPLOY_ENV=dev
- DISCOVERY_NODES=127.0.0.1:7171
2019-07-05 11:43:35 +02:00
- HTTP_PERF=tcp://0.0.0.0:0
2019-10-12 06:02:47 +02:00
- DOCKER_COMPOSE_VERSION=1.24.1
2019-11-05 08:11:41 +02:00
- ZK_VERSION=3.5.6
2019-10-12 06:02:47 +02:00
before_install:
2019-11-05 07:48:48 +02:00
# docker-compose
2019-10-12 06:02:47 +02:00
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
2019-11-05 07:48:48 +02:00
# zookeeper
2019-11-05 08:17:19 +02:00
- wget "http://apache.cs.utah.edu/zookeeper/zookeeper-${ZK_VERSION}/apache-zookeeper-${ZK_VERSION}-bin.tar.gz"
- tar -xvf "apache-zookeeper-${ZK_VERSION}-bin.tar.gz"
2019-11-05 08:29:28 +02:00
- mv apache-zookeeper-${ZK_VERSION}-bin zk
2019-11-05 08:32:00 +02:00
- chmod +x ./zk/bin/zkServer.sh
2019-02-01 09:57:43 +02:00
# Skip the install step. Don't `go get` dependencies. Only build with the code
# in vendor/
install: true
# Anything in before_script that returns a nonzero exit code will flunk the
# build and immediately stop. It's sorta like having set -e enabled in bash.
# Make sure golangci-lint is vendored.
before_script:
- curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $GOPATH/bin
2019-11-05 07:48:48 +02:00
# discovery
- curl -sfL https://raw.githubusercontent.com/bilibili/discovery/master/install.sh | sh -s -- -b $GOPATH/bin
- curl -sfL https://raw.githubusercontent.com/bilibili/discovery/master/cmd/discovery/discovery-example.toml -o $GOPATH/bin/discovery.toml
- nohup bash -c "$GOPATH/bin/discovery -conf $GOPATH/bin/discovery.toml &"
2019-11-05 07:48:48 +02:00
# zookeeper
2019-11-05 08:29:28 +02:00
- sudo ./zk/bin/zkServer.sh start ./zk/conf/zoo_sample.cfg 1> /dev/null
2019-02-01 09:57:43 +02:00
script:
- go build ./...
- go test ./...
2019-02-01 09:57:43 +02:00
after_success:
- golangci-lint run # run a bunch of code checkers/linters in parallel