Владимир Томишинец 5 years ago
parent
commit
acc50dbfbf
2 changed files with 4 additions and 2 deletions
  1. 2 1
      Dockerfile
  2. 2 1
      RenewalJenkinsfile

+ 2 - 1
Dockerfile

@@ -24,7 +24,8 @@ RUN mkdir -p /etc/acme-dns && mkdir -p /var/lib/acme-dns && mkdir /etc/letsencry
     && ln -sf /usr/bin/python3 /usr/bin/python \
     && curl -o /etc/letsencrypt/acme-dns-auth.py \
 	https://raw.githubusercontent.com/joohoi/acme-dns-certbot-joohoi/master/acme-dns-auth.py \
-    && chmod 0700 /etc/letsencrypt/acme-dns-auth.py
+    && chmod 0700 /etc/letsencrypt/acme-dns-auth.py \
+    && sed -i "s/MY_NAME  = \'Your Real Name\'/MY_NAME  = \'jenkins.dev\'/" /etc/email/email.conf
 
 ENTRYPOINT ["/entrypoint.sh"]
 EXPOSE 53

+ 2 - 1
RenewalJenkinsfile

@@ -40,6 +40,7 @@ pipeline {
             BACKUP_FILE = PKI_GIT_NAME + '/' + PKI_GIT_SUBDIR + '/wildcard/acme-dns/' + DOMAIN + '.dump.gz'
             COMMAND = PKI_GIT_NAME + '/' + PKI_GIT_SUBDIR + '/wildcard/acme-dns/' + 'renewal.sh'
             withCredentials([usernamePassword(credentialsId: 'jenkins', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
+              JENKINS_USER = USERNAME
               JENKINS_PASS = PASSWORD
             }
           }
@@ -51,7 +52,7 @@ pipeline {
             sh """set +x
                   DOCKER_HOST=tcp://${CLUSTER_NAME_OPEN}:2376 DOCKER_TLS_VERIFY=1 docker run -t --rm -e TZ=Europe/Moscow \
                     -e DOMAIN=${DOMAIN} -e CONFIG_DIR=${CONFIG_DIR} -e BACKUP_FILE=${BACKUP_FILE} \
-                    -e JENKINS_MAIL_PASS=${JENKINS_PASS} -e JENKINS_MAIL_USER=${JENKINS_MAIL} \
+                    -e JENKINS_MAIL=${JENKINS_MAIL} -e JENKINS_MAIL_USER=${JENKINS_USER} -e JENKINS_MAIL_PASS=${JENKINS_PASS} \
                     -e git_url=${PKI_GIT_URL} -e SMTP_SERVER=${SMTP_SERVER} -e RECIPIENT_MAIL_BOX=${RECIPIENT_MAIL_BOX} \
                     -e "SSHKEY=`cat ${GIT_SSH_KEY}`" -p 53:53/udp -p 53:53/tcp ${IMAGE_NAME} \
                     /${COMMAND}