changing procedure

This commit is contained in:
Artur Kuś 2025-09-22 22:40:38 +02:00
parent e54816a072
commit 4b9181e44e
1 changed files with 7 additions and 3 deletions

View File

@ -31,7 +31,11 @@ def createCert(domains) {
if (fileExists(fileName)) {
def certInfo = sh(
script: "openssl x509 -in ${fileName} -text -noout | grep -o 'DNS:[^,]*' | sed 's/DNS://g'",
script: """
openssl x509 -in ${fileName} -text -noout \
| grep 'DNS:' \
| sed 's/.*DNS://;s/, /\\n/g'
""",
returnStdout: true
).trim()
@ -82,6 +86,7 @@ def createCert(domains) {
--cert-name='${name}' \
--non-interactive --agree-tos \
--preferred-challenges http \
--expand \
--email ${email} \
-d ${name} ${subDomains}
""".stripIndent()
@ -100,10 +105,9 @@ pipeline {
stage('Make https cert for my domains') {
steps {
script {
createCert(domainsToCert)
}
}
}
}
}
}