0

I configured Jenkins on the EC2 instance yesterday. Jenkins was successfully sending post build notifications with the build URL (EC2_PublicDNS/job/build_name/build_number) in my inbox. I restarted my EC2 instance on AWS today and the public DNS changes when we restart the instance. Currently, Jenkins is sending me email notifications with the build URL of the previous public DNS. How can I fix Jenkins to send the build URL with current public DNS of EC2 instance?

    post {
    success {
        mail to: 'abc@test.com',
            subject: "Success: ${currentBuild.fullDisplayName}",
            body: "Pipeline is executed successfully for build ${env.BUILD_URL}"
            }
         }
bot
  • 1,293
  • 3
  • 17
  • 34
  • Thank you. I deleted the URL from 'Configure System', saved and closed it. The URL was automatically set to the new public DNS of my EC2 instance when I restarted the same settings. Jenkins sets the default URL only once or it might be an issue with EC2 instances? – bot Jan 22 '19 at 20:29
  • It shouldn't touch it, ever, it's a feature it sets it at all not an issue with not setting it. And restarting EC2 doesn't change it's IP, it changes if you shut it down and power it on again. Attach a subdomain to it to avoid troubles. – Jakub Kania Jan 22 '19 at 20:52
  • I restarted the EC2 instance and it changed the public DNS. I was getting connection time out issue and I resolved it after looking at this response - https://stackoverflow.com/a/33294501/9273701 – bot Jan 22 '19 at 22:03
  • Can you please elaborate more on 'It shouldn't touch it, ever, it's a feature it sets it at all not an issue with not setting it'. – bot Jan 22 '19 at 22:04
  • Well, the URL of your server shouldn't be changing all the time, get a domain. – Jakub Kania Jan 23 '19 at 10:36

0 Answers0