Auto pull root certificate and key from Jenkins vault #33

Merged
mpavlov merged 1 commits from dev into master 2025-07-29 01:27:49 +03:00

10
Jenkinsfile vendored
View File

@@ -41,9 +41,13 @@ pipeline {
}
steps {
script {
def userInput = input message: 'Upload RootCA certificate and key', parameters: [base64File(name: 'rootca'), base64File(name: 'rootca_key')]
writeFile(file: 'roles/rproxy/files/RootCA.crt', text: new String(userInput['rootca'].decodeBase64()))
writeFile(file: 'roles/rproxy/files/RootCA.key', text: new String(userInput['rootca_key'].decodeBase64()))
withCredentials([
file(credentialsId: "ROOTCA_CERT", variable: "rootca"),
file(credentialsId: "ROOTCA_KEY", variable: "rootca_key")
]) {
sh(script: "cp ${rootca} roles/gitlab/files/RootCA.crt", returnStdout: false)
sh(script: "cp ${rootca_key} roles/gitlab/files/RootCA.key", returnStdout: false)
}
}
}
}