1 回答
TA贡献1844条经验 获得超8个赞
这可能很简单,但是对于特定的操作系统无法完成矩阵环境......
然后只需选择本地环境变量:
language: go
go:
- 1.5.1
branches:
only:
- master
os:
- osx
- linux
install:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
export GIMME_OS=windows;
export GIMME_ARCH=amd64;
fi
before_script:
- go get -d -v ./...
script:
- go build -v ./...
after_script:
- go test -v ./...
before_deploy:
- ./before_deploy.sh
其它的办法:
language: go
go:
- 1.5.1
branches:
only:
- master
matrix:
include:
- os: linux
env: GIMME_OS=windows; GIMME_ARCH=amd64;
- os: osx
before_script:
- go get -d -v ./...
script:
- go build -v ./...
after_script:
- go test -v ./...
before_deploy:
- ./before_deploy.sh
注意: commande:- chmod +x ./before_deploy.sh可以直接在您的存储库中完成并提交...
注意:环境变量可以访问:http : //docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables或调用\printenv`
- 1 回答
- 0 关注
- 214 浏览
添加回答
举报