-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvault
28 lines (28 loc) · 889 Bytes
/
vault
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// define vault configuration
def configuration = [engineVersion: 1,
skipSslVerification: true,
timeout: 60,
vaultUrl: "http://192.168.44.3:8200/",
vaultCredentialId: "op2-vault-token"]
// define vault secret path and env var
def secret = [
[path: 'secret/jenkins', secretValues: [
[envVar: 'ENV_USER', vaultKey: 'username'],
[envVar: 'ENV_PASS', vaultKey: 'password']]]
]
pipeline{
agent any
stages{
stage('access vault'){
steps{
withVault([configuration: configuration, vaultSecrets: secret]) {
sh '''
pwd
echo ${ENV_USER} > test_data
cat test_data
'''
}
}
}
}
}