Custom state elements in the Jenkins singleton

13 views
Skip to first unread message

Kamil Dzierżanowski

unread,
Feb 27, 2019, 7:00:48 AM2/27/19
to Jenkins Users
In the init scripts, I'm using Grape to get com.bettercloud:vault-java-driver:4.0.0. It is then used by creating an instance of the Vault client, such as:

def vaultConfig = new VaultConfig()
 
.address(vaultUrl)
 
.token(vaultToken)
 
.sslConfig(new SslConfig().build())
 
.build()

Integer vaultEngineVersion = 1
def vault = new Vault(vaultConfig, vaultEngineVersion)

I'd like to persist the vault variable shown above across various init scripts that will be executed after this. Is there a mechanism to write custom objects as state of the Jenkins (or any other) singleton?

Thanks,
Kamil
Reply all
Reply to author
Forward
0 new messages