Jenkins

Jenkins: 13 - What is Pipeline in Jenkins

What is Pipeline in Jenkins

  • Workflow with group of events or jobs that are chained & integrated with each other in sequence.
  • Every job in a pipeline has some dependency on one or more other jobs

Continuous Delivery Pipeline

  • Build Jobs
    • Notification Feedback
  • Deploy Jobs
    • Notification Feedback
  • Test Jobs
    • Notification Feedback
  • Release Jobs
    • Notification Feedback

 

Tags

Jenkins: 12 - Jenkins Email Notifications

Jenkins Email Notifications

Note: firewall settings might need to be updated for BOTH outbound & inbound ports

  • Extended E-mail Notification
    • SMTP server
    • Default user E-mail suffix
    • Use SMTP Authentication
      • UserName
      • Password
    • Advanced Email Properties
    • Use SSL
    • SMTP port
      • 465
    • Charset UTF-8

 

 

Test Configuration

'Email was successfully sent'

 

 


Notification Plugin

https://plugins.jenkins.io/notification

 

 


Extreme Notification Plugin

https://plugins.jenkins.io/extreme-notification

Tags

Jenkins: 02 - Install on Tomcat

PreReq: JDK7/8

 

Add tomcat user & add to sudoer list

sudo adduser tomcat
sudo passwd tomcat
Changing password for user tomcat.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
sudo gpasswd -a tomcat wheel
Adding user tomcat to group wheel

 


Create tomcat group & adduser

sudo groupadd tomcat

Then create a new tomcat user. We'll make this user a member of the tomcat group, with a home directory of /opt/tomcat (where we will install Tomcat), and with a shell of /bin/false (so nobody can log into the account):

sudo useradd -M -s /bin/nologin -g tomcat -d /opt/tomcat tomcat

Now that our tomcat user is set up, let's download and install Tomcat.

 

Jenkins: 11 - Automated Deployment in Jenkins(Tomcat sample.war)

Automated Deployment in Jenkins

 

put sample.war in project workspace

place sample.war in the build workspace

/opt/jenkins/workspace/AutomatedDeploymentTest/sample.war

 

General

Description

<h3>Deploy a war file to system</h3>

Use Custom Workspace

${JENKINS_HOME}/workspace/AutomatedDeploymentTest

Display Name

AutomatedDeploymentTest

 

Build

Command

pwd

 

Post Build

Deploy WAR/EAR file to container

**/*.war

Context path

sample.war

Containers

Tomcat 7.x

Credentials

deployer | deployer

Note: Tomcat user MUST have 'manager-script' role assigned in tomcat [ /opt/tomcat/conf/tomcat-users.xml ]

<user username="deployer" password="deployer" roles="manager-script"/>

Tomcat URL

Jenkins: 10 - Automated Deployment ( Jenkins Chaining )

Automated Deployment ( Jenkins Chaining )

CI Stages

Build > Deploy > Test > Release

 

Automated Deployment is the process of Automating the deployment process in a Continuous Delivery system

 

  • Developers > Commit > VCS
  • Jenkins Build Job > Poll > VCS
  • Jenkins Deploy > Environments (Functional, Performance)
  • Jenkins Deploy > Environments (Production)

 

 

 

 

 

 

Tags

Jenkins: 07 - Getting Started with Jobs

Jenkins Jobs

Add Project Item

Descriptiong

 

Source Code Management

None \ Git \ Subversion

 

Build Triggers

  • Remotely
    • Add Token (1234)
    • Jenkins will provide URL
      • <ip>:8080/job/TestJavaProject1/build?token=1234
      • Tried wget on linux, but getting access denied(is it possible?)
        • even with --referer and --user uname:pwd
  • Before Build
  • After Build
    • Cascade Projects
      • Based on health?

 

 

Tags

Jenkins 05 - Manage Users/Roles

Managing Users & Roles

Default Logic

  • Before Roles are Created, ALL users are admin
  • Need Role Strategy Plugin to create/manage 'Roles'
    •  
  • Create Roles, then assign users to lock system down
  • Manage Jenkins > Manage Users > Create User
  • API Token
  • User must login to view the API Token ( for REST calls to Jenkins )

Role Strategy Plugin

Manual Installation

Download Manually

cd /var/lib/jenkins/plugins
wget --no-cookies "https://updates.jenkins.io/download/plugins/role-strategy/2.8.1/role-strategy.hpi"
systemctl restart jenkins

 

Tags
Subscribe to Jenkins