Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…erence into issue143
  • Loading branch information
alexsedova committed Mar 24, 2017
2 parents 7e48026 + adb7f60 commit eefc489
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
16 changes: 16 additions & 0 deletions dockerizeit/master/globalconfig.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,22 @@ def desc = inst.getDescriptor("hudson.plugins.git.GitSCM")
desc.setGlobalConfigName(properties.global.git.name)
desc.setGlobalConfigEmail(properties.global.git.email)

if(properties.global.smtp.enabled) {
println "--> Set E-mail Notification"
if(properties.global.smtp.authentication.enabled) {
File pwdFile = new File(properties.global.smtp.authentication.passwordFile)
if(!pwdFile.exists()) {
println "Smpt password file missing!"
} else {
def emailDesc = inst.getDescriptor(hudson.tasks.Mailer)
emailDesc.setSmtpHost(properties.global.smtp.host)
emailDesc.setSmtpPort(properties.global.smtp.port)
emailDesc.setSmtpAuth(properties.global.smtp.authentication.login, pwdFile.text.trim())
emailDesc.setReplyToAddress(properties.global.smtp.reply_to_address)
}
}
}

println "--> Set system message "
def env = System.getenv()
if ( env.containsKey('master_image_version') ) {
Expand Down
11 changes: 11 additions & 0 deletions dockerizeit/master/jenkins.properties
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ global {
master_image_name = "${images.masterImageName}"
slave_image_name = "${images.slaveImageName}"
}
smtp {
enabled = false
port = "25"
host = "1.1.1.1"
reply_to_address = "[email protected]"
authentication {
enabled = true
login = "jenkins"
passwordFile = "/var/jenkins_home/.ssh/.smtp_password"
}
}
}

libraries{
Expand Down

0 comments on commit eefc489

Please sign in to comment.