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)) { if (fileExists(fileName)) {
def certInfo = sh( 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 returnStdout: true
).trim() ).trim()
@ -82,6 +86,7 @@ def createCert(domains) {
--cert-name='${name}' \ --cert-name='${name}' \
--non-interactive --agree-tos \ --non-interactive --agree-tos \
--preferred-challenges http \ --preferred-challenges http \
--expand \
--email ${email} \ --email ${email} \
-d ${name} ${subDomains} -d ${name} ${subDomains}
""".stripIndent() """.stripIndent()
@ -100,7 +105,6 @@ pipeline {
stage('Make https cert for my domains') { stage('Make https cert for my domains') {
steps { steps {
script { script {
createCert(domainsToCert) createCert(domainsToCert)
} }
} }