Jenkins pushes app to wrong target

2019-08-22 05:03发布

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条回答
等我变得足够好
2楼-- · 2019-08-22 05:23

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
    
查看更多
登录 后发表回答