2016-07-29 95 views
0

預期目標(僞代碼)特拉維斯CI,部署到2個應用基於標籤

if (tag) { deploy to live-app} 
else { deploy to test-app} 

事情我已經嘗試:

deploy: 
    provider: heroku 
    app: live-app 
    api_key: 
    secure: ... 

deploy: 
    provider: heroku 
    app: test-app 
    on: 
    tags: true 
    all_branches: true # needed due to travis limitation, we deploy only on master 
    api_key: 
    secure: ... 

這導致特拉維斯忽略首先部署安裝的測試應用。

有什麼想法?

我知道我可以寫我自己的腳本來做到這一點,只是想知道如果有一個更清潔「的travisy」的解決方案,因爲這聽起來好像是一個很常見的場景

回答

1

試試這樣說:

deploy: 
    - provider: heroku 
     app: live-app 
     api_key: 
     secure: ... 
     on: 
     tags: false 

    - provider: heroku 
     app: test-app 
     on: 
     tags: true 
     all_branches: true # needed due to travis limitation, we deploy only on master 
     api_key: 
     secure: ... 
+0

作品!非常感謝 :) – goldylucks