Skip to content

Latest commit

 

History

History
89 lines (54 loc) · 3.15 KB

Step4.md

File metadata and controls

89 lines (54 loc) · 3.15 KB

click here to go back to the main README.

Step 4 - Create Deployment Job

Table of Contents


create Deployment job

Since we can't actually deploy our test application we have chosen to simulate this step by creating a notification step instead.

Go back to your Jenkins Dashboard if not already there.

Go to "New item". Enter “Deploy” as the item name and choose "Freestyle project"

alt text

Ok so below steps are some you have done in the previous three steps so i'll save you the extra images and repeat the steps which we have done before:

  • Enter https://github.com/__username__/bootcamp-jenkins-example.git in the field "Repository URL".
  • Make sure you use your own username
  • Go to "Build" and select "ADD BUILD STEP". Choose "Invoke top-level Maven targets". Select "M3" in the "Maven Version" dropdown menu.
  • Enter "clean compile" in the "Goals" field.

What is new is that we are defining a post-build action. This is a action performed after a build has taken place. This can either be successful or not.

Note: you need to have a build step definied in order for this to work.

go to the "Post-build actions" tab and define an email notification

alt text

enter your own mail address or "[email protected]" into the mail address

alt text

additionally you can check either boxes to have individual mails sent (not configured) or to send a mail upon broken builds

Click on "Save".

Run Deployment Job

Probably not because we did not configure our e-mail settings in Jenkins.

Configure mail

  • Go back to your Jenkins Dashboard if not already there.
  • Go to the Jenkins configuration: -> Manage Jenkins -> System Configuration
  • configure the email settings. A good source for this is the gmail SMTP

alt text

The following settings can be used

SMTP Server: SMTP.gmail.com
Use SMTP Auth: Yes
Username: full gmail address
password: ************
Use SSL: Yes
Port: 465

After configuring you can let Jenkins send a test mail. Please do so to test the configuration

Two-Factor Authentication

Two-factor auth requires a different approach.

Re-run Job

Try the job several times working or not working and behold the notifications (spam) coming in:

alt text alt text


Back to top

click here to go back to the main README.