Skip to content

Commit 624cdb8

Browse files
authored
Merge pull request #900 from elismaga/ST-3402
ST-3402: Refactored Jenkinsfile to get secrets from Vault instead of Jenkins credential store
2 parents 675cc25 + 7aeac7b commit 624cdb8

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

tests/system/Jenkinsfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,23 @@ def config = jobConfig {
88
}
99

1010
def job = {
11-
withCredentials([
12-
file(credentialsId: 'muckrake-2017-06-01.pem', variable: 'MUCKRAKE_PEM')]) {
13-
sshagent(['ConfluentJenkins Github SSH Key']) {
14-
configFileProvider([configFile(fileId: 'jenkins-maven-global-settings',
15-
targetLocation: '/home/jenkins/.m2/settings.xml')]) {
16-
stage("Run tests") {
17-
sh 'tests/system/run-tests.sh'
18-
}
11+
configureGitSSH("github/confluent_jenkins", "private_key")
12+
withVaultEnv([["artifactory/tools_jenkins", "user", "TOOLS_ARTIFACTORY_USER"],
13+
["artifactory/tools_jenkins", "password", "TOOLS_ARTIFACTORY_PASSWORD"],
14+
["sonatype/confluent", "user", "SONATYPE_OSSRH_USER"],
15+
["sonatype/confluent", "password", "SONATYPE_OSSRH_PASSWORD"]]) {
16+
withVaultFile([["maven/jenkins_maven_global_settings", "settings_xml",
17+
"/home/jenkins/.m2/settings.xml", "MAVEN_GLOBAL_SETTINGS"],
18+
["muckrake/2017-06-01", "pem", "muckrake-2017-06-01.pem", "MUCKRAKE_PEM"]]) {
19+
stage("Run tests") {
20+
sh 'tests/system/run-tests.sh'
1921
}
2022
}
2123
}
2224
}
2325

2426
def post = {
25-
withCredentials([file(credentialsId: 'muckrake-2017-06-01.pem', variable: 'MUCKRAKE_PEM')]) {
27+
withVaultFile([["muckrake/2017-06-01", "pem", "muckrake-2017-06-01.pem", "MUCKRAKE_PEM"]]) {
2628
stage('Cleanup tests') {
2729
sh 'tests/system/cleanup-tests.sh'
2830
}

0 commit comments

Comments
 (0)