You are on page 1of 7

Jenkins

Scm

Build triggers

Build

Post-build Actions

1 Terminology of Jenkins

2 Create first Jenkins job

3 Run the first Jenkins job

4 Install Github Plug-in on Jenkins

5 Configure Jenkins to work with JAVA,GIT and maven (Global Configuration)

6 To build First Maven based Jenkins Project

Maven Life Cyle

Validate-----Compile--------Test (Unit Testing framework)-------Package -----Verify (Integration test)----


-install---Deploy

Here we use a maven command goals in maven mvn clean package

Maven Project .pom

Server .jar

Webapp .war

7 To run the job builds in 6 manually or to trigger the build.

Need to take in consideration the Java home path and Maven home path

8 To run the job automatically or to trigger automatically

Cron Syntax

Min, hr, day of the month, month, day of the week,

Example

0 2-4 *** where 2-4 is 2am, 3am, 4am

9 To build the trigger

Using the Token trigger build remotely


Build after other projects are build

Build periodically

Hook up where ever the changed are pushed in Git Hub repo it enable the builds

10 Jenkins Code Quality metric reports

Checkstlye plug in : works on code base to find the warnings which can be corrected

Provide goals in Maven: cleanstyle:cleanstyle

Plug in PMD

11 Jenkins Support for gradle ant and Shell scripts

12 How to archive the file

After the maven job is run we get a file which is then archive and artifacts are generated so that it
can be used by testers for manual testing so that it can further deployed

Post build section: Archive the artifacts

To archive the file we need to specify the file **/*.war which means all files with the extension .war

13 To install Tom cat

Tom cat is a open source web server environment in which java code can be run.

Default Tomcat and Jenkins run on the same port 8080 so we need to change the port of Tomcat
otherwise there will be conflicts.

So we need to go to the file server.xml to make the changes

C:\Users\ADMIN\Desktop\Devops\SOFTWARES\TomCat\apache-tomcat-8.5.33\conf\server.xml

We need to search connector and change the port to 8090 or whatever you want

We need to also change the role for that we need to open the file tomcat-users.xml

C:\Users\ADMIN\Desktop\Devops\SOFTWARES\TomCat\apache-tomcat-8.5.33\conf\ tomcat-
users.xml

Role name : manager-script

Role name : admin-gui

User name tomcat and password tomcat and role the above two

14 To install the plug-in copy artifact and Deploy to the container

Wipro Tutorials

1 Configuration of proxy in Jenkins should be same (To Install Plugin)


Configuration of Jenkins, system, other tools (eclipse, maven)

System and Jenkins should have same proxy settings

System: export

Jenkins: advanced

2 configure the plug-in and check if they are available or not (Installed)

3 Global Tool Configurations

JDK

4 New job creation: using a Shell Build execution

5 Global security configurations

Day 4

Maven

To create the below structure for jar file.

Create a directory named B7maven

Create a Folder name as EXb in b7maven

Create a folder src into it EXb

Created file pom.xml in EXb

Within src folder need to created with folder main (Application code, Business Code), test,

In test folder create folder name java

In main folder create folder name java

To run the below command on the terminal

mvn archetype :generate -DgroupId=com.example1 -DartifactId=Ex1 - DarchetypeArtifactId=maven-


archetype-quickstart -DinteractiveMode=false
Compilation in java =.class

Python .pyc

*app code (.class)

*test code (.class)

Packaging

*combine compiled files

-test,is success then to only package

Maven Goals

Compile,test-compile,test,package,install,deploy
Run the command at the maven folder

mvn archtype:generate

select the archetype from the numbers

define groupId

define artifactoryid

define version

define package

You might also like