Skip to content

Feature: Added a groovy script for Configuring SMTP - #17

Open
bzon wants to merge 1 commit into
Accenture:masterfrom
bzon:master
Open

Feature: Added a groovy script for Configuring SMTP#17
bzon wants to merge 1 commit into
Accenture:masterfrom
bzon:master

Conversation

@bzon

@bzon bzon commented Jul 1, 2016

Copy link
Copy Markdown

@nickdgriffin @anton-kasperovich

Contributing the groovy script that we are currently using in our project. It configures the SMTP settings for Extended Email and Mail Server in "Manage Jenkins".

Example required variables:

ADOP_SMTP_ENABLED=true
SMTP_SYSAD_EMAIL=john.smith@gmail.com
SMTP_USER=john.smith@gmail.com
SMTP_PASSWORD=password123
SMTP_PORT=25
SMTP_HOST=smtp.gmail.com

@wyarde this is our pull request.

Works well with a Mail Server container - See Pull request - Accenture/adop-docker-compose#111

Comment thread resources/init.groovy.d/smtp.groovy Outdated
def extmailServer = instance.getDescriptor("hudson.plugins.emailext.ExtendedEmailPublisher")

Thread.start {
sleep 15000

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other groovy scripts have 10000 sleep timeout, is 15000 added for a reason?

@anton-kasperovich

Copy link
Copy Markdown
Contributor

@bzon please squash commits, instead of 4 there should be only 1, i leaved a comment about sleep time, everything else looks good, great PR, thank you!

@bzon

bzon commented Jul 1, 2016

Copy link
Copy Markdown
Author

@anton-kasperovich the 15000 was just for testing purposes. Ok I will make it 10000 and will squash commits!

update

changed SMTP_ENABLED to ADOP_SMTP_ENABLED

changed README

Changed sleep 15000 to 10000
@bzon bzon changed the title Added a groovy script for Configuring SMTP Feature: Added a groovy script for Configuring SMTP Jul 3, 2016
@anton-kasperovich

Copy link
Copy Markdown
Contributor

👍

@anton-kasperovich

Copy link
Copy Markdown
Contributor

@nickdgriffin i'm happy to merge it, not sure, did you had a reason why it wasn't merged or just busy? i think it's obvious that emails should be send from Jenkins

@RobertNorthard

Copy link
Copy Markdown
Contributor

@bzon please can you rebase?

@coltrey

coltrey commented Aug 21, 2018

Copy link
Copy Markdown

Shouldn't the setters be used instead of direct assignment for the hudson.plugins.emailext.ExtendedEmailPublisher descriptor?

extmailServer.setSmtpUsername()
extmailServer.setSmtpPassword()
extmailServer.setSmtpServer()
extmailServer.setSmtpPort()
extmailServer.setUseSsl()
extmailServer.setCharset()

@bzon

bzon commented Aug 21, 2018

Copy link
Copy Markdown
Author

@RobertNorthard @coltrey I wouldn't mind if someone can pick up and continue my proposed changes here. I've already the deleted the source forked repo for this PR.

@LQss11 LQss11 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you allow the script to configure jenkins E-mail Notification?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants