[JIRA] (JENKINS-45685) Declarative Pipeline Example
Title: Message Title vassil marjunits edited a comment on JENKINS-45685 Re: Declarative Pipeline Example After version 2.3.0 and higher, 3.0.0 was latest, when this comment was made{code:java}// define vault configurationdef configuration = [engineVersion: 1, skipSslVerification: true, timeout: 60, vaultUrl: "http://my-vault.com:8200", vaultCredentialId: "my-vault-cred-id"]// define vault secret path and env vardef secret = [ [path: 'dev/kv1', secretValues: [[envVar: 'PASSWORD', vaultKey: 'password'],[envVar: 'USER', vaultKey: 'user' pipeline {agent anyoptions {buildDiscarder(logRotator(numToKeepStr: '20'))disableConcurrentBuilds()}stages{ stage('Vault') {steps {script {withVault([configuration: configuration, vaultSecrets: secret]) { sh 'echo $PASSWORD' sh 'echo $USER'}}} }}post {always {cleanWs()}}}{code} Add Comment This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.183881.1500551847000.10306.1571393820420%40Atlassian.JIRA.
[JIRA] (JENKINS-45685) Declarative Pipeline Example
Title: Message Title vassil marjunits edited a comment on JENKINS-45685 Re: Declarative Pipeline Example After version 2.3.0 and higher,3.0.0 was latest, when this comment was made{code:java}// define vault configurationdef configuration = [engineVersion: 1,skipSslVerification: true,timeout: 60,vaultUrl: ' " http:// 172 my-vault . 21.0.2 com :8200 ' " ,vaultCredentialId: "my-vault-cred-id"]// define vault secret path and env vardef secret = [ [path: 'dev/kv1', secretValues: [[envVar: 'PASSWORD', vaultKey: 'password'],[envVar: 'USER', vaultKey: 'user'pipeline {agent anyoptions {buildDiscarder(logRotator(numToKeepStr: '20'))disableConcurrentBuilds()}stages{ stage('Vault') {steps {script {withVault([configuration: configuration, vaultSecrets: secret]) { sh 'echo $PASSWORD' sh 'echo $USER'}}} }}post {always {cleanWs()}}}{code} Add Comment This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.183881.1500551847000.10300.1571393760243%40Atlassian.JIRA.
[JIRA] (JENKINS-45685) Declarative Pipeline Example
Title: Message Title vassil marjunits commented on JENKINS-45685 Re: Declarative Pipeline Example After version 2.3.0 and higher, 3.0.0 was latest, when this comment was made // define vault configuration def configuration = [engineVersion: 1, skipSslVerification: true, timeout: 60, vaultUrl: 'http://172.21.0.2:8200', vaultCredentialId: "my-vault-cred-id"] // define vault secret path and env var def secret = [ [path: 'dev/kv1', secretValues: [ [envVar: 'PASSWORD', vaultKey: 'password'], [envVar: 'USER', vaultKey: 'user']]] ]pipeline { agent any options { buildDiscarder(logRotator(numToKeepStr: '20')) disableConcurrentBuilds() } stages{ stage('Vault') { steps { script { withVault([configuration: configuration, vaultSecrets: secret]) { sh 'echo $PASSWORD' sh 'echo $USER' } } } } } post { always { cleanWs() } } } Add Comment This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to
[JIRA] (JENKINS-45685) Declarative Pipeline Example
Title: Message Title Arturas R commented on JENKINS-45685 Re: Declarative Pipeline Example Hope it helps pipeline { agent none stages { stage('Vault') { agent { node { label 'linux' } } steps { script { node { // define the secrets and the env variables def secrets = [ [$class: 'VaultSecret', path: 'secret/testing', secretValues: [ [$class: 'VaultSecretValue', envVar: 'testing', vaultKey: 'value_one'], [$class: 'VaultSecretValue', envVar: 'testing_again', vaultKey: 'value_two']]], [$class: 'VaultSecret', path: 'secret/another_test', secretValues: [ [$class: 'VaultSecretValue', envVar: 'another_test', vaultKey: 'value']]] ] // optional configuration, if you do not provide this the next higher configuration // (e.g. folder or global) will be used def configuration = [$class: 'VaultConfiguration', vaultUrl: 'http://my-very-other-vault-url.com', vaultCredentialId: 'my-vault-cred-id'] // inside this block your credentials will be available as env variables wrap([$class: 'VaultBuildWrapper', configuration: configuration, vaultSecrets: secrets]) { sh 'echo $testing' sh 'echo $testing_again' sh 'echo $another_test' } } } } } } } } Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are
[JIRA] (JENKINS-45685) Declarative Pipeline Example
Title: Message Title Sean Middleton commented on JENKINS-45685 Re: Declarative Pipeline Example Hi, was there any update on this issue in the end? Looking to use the Vault plugin with a declarative pipeline but some information I've read suggests declarative pipelines aren't currently supported with the Vault plugin? Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.