Jenkins pushes app to wrong target

≯℡__Kan透↙ 提交于 2019-12-11 23:26:36

问题


we continuously build our apps with Jenkins and deploy them to our different spaces:

...
cf login -a https://api.lyra-836.appcloud.swisscom.com -u ...
cf target -s development
cf push scs-flux-monitoring-development
...

Now we recognized that the push is sometimes taking a wrong space to install the app. We think this is because of another Jenkins Job doing a parallel push. As far we can see the .cf/config.json stores the name of the Space and when another cf target is called all pushes are using that new target.

Anyone who recognized that behaviour also? Any suggestions to solve that?

Kind regards

Josef


回答1:


There are a couple options you could go with:

  1. Don't use a CI solution that allows shared state between different jobs. Just as Cloud Foundry uses containers to isolate apps, there are CI solutions out there that use containers to isolate builds. One great example is Concourse CI which is actually the main solution used by the core Cloud Foundry development teams.

  2. Have every Jenkins job use a different location for CF_HOME so they don't all share ~jenkins/.cf:

    $ cf help | grep CF_HOME
       CF_HOME=path/to/dir/               Override path to default config directory
    


来源:https://stackoverflow.com/questions/35222768/jenkins-pushes-app-to-wrong-target

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!