2017-06-16 64 views
0

我有以下.travis.yaml文件:传递ENV变量特拉维斯具体部署

branches: 
    only: 
    - master 
    - develop 
language: node_js 
node_js: 
    - "7.9.0" 
script: 
    - make build 
deploy: 
    - provider: s3 
    local_dir: build 
    acl: public_read 
    skip_cleanup: true 
    bucket: "app-dev-us-east-1" 
    region: "us-east-1" 
    on: 
     branch: develop 
    - provider: s3 
    local_dir: build 
    acl: public_read 
    skip_cleanup: true 
    bucket: "app-prod-us-east-1" 
    region: "us-east-1" 
    on: 
     branch: master 

在我的脚本:使身材,什么是通过基于分支不同的环境变量的正确方法正在建造?

还是我必须修改我的makefile并拉动TRAVIS_BRANCH并使用它?

任何意见是非常赞赏

+0

[Travis CI测试分支与相应的一组环境变量]可能重复(https://stackoverflow.com/questions/21099377/travis-ci-testing-branches-with-corresponding-set-of-environment-variables ) –

回答

0

其实这个问题已经asked before

answers之一表示您可以在每个分支上有不同的.travis.yml。然而,这个问题将与这些分支之间的合并有关。但是,您总是可以将.travis.yml添加到.gitignore以忽略合并期间的这些差异。