can globally defined these common API Keys/Credentials to be shared across multiple build configs / projects ?
Hi Team
I have a use case, where I want to store API tokens/ Credentials centrally used in build configuration - For example "Commit status publisher (Bitbucket cloud) or Snyk scanner". We are using Kotlin based build config making defining new build config via repo only. Here the issue we are facing is, we want to set these credentials centrally so that in case of any changes, we can change them in the root project and it should automatically get propagated to child projects.We tried defining the variables on Configuration Parameters of the root projects, and refer them in the build config file. But what we can see is that, credentials are not getting dynamically updated with root's parameter when changed.is there a way we can globally defined these common API Keys/Credentials to be shared across multiple build configs / projects ?
Please sign in to leave a comment.
first of all, if you define the variables at the root project level, all subprojects and build configurations should collect updated values. Because of this, it is also recommended trying to limit the scope of those credentials to the top project where they are needed rather than the root project. This said, if you had defined them first at the project/build configuration level with the same ID and did not remove them after creating them in the root project, the value will not be inherited, it will be overridden by the value defined in the build configuration. If you remove the definition fromthe build configuration and leave it only in the root project, then that should work.
Of note, this won't be applied to already queued builds, only new builds would collect the new values.