Tomcat

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

Subscribe to Tomcat