Вы находитесь на странице: 1из 5

Stage 2(Continuous Build)

-------------------------
The code downloaded on the previous stage has to be compiled and bundled as
an artifact.This artifact can be a jar,war,ear file.

1 Download apache maven from


http://maven.apache.org/download.cgi
(Download the .bin.zip version)

2 Extract it and open it copy its path

3 Open the dashboard of jenkins(localhost:8080)

4 Click on Global tool configurations

5 Go to Maven Installations

6 Give some name to maven(mymaven)

7 Paste the path of maven that we downloaded in MAVEN_HOME

8 Go to the dashboard of jenkins-->Go to the Development job-->Click on Configure

9 Go to Build section-->Add build step-->Invoke top level maven targets-->Enter


maven goal as package
Note: package is a stage in maven life cycle which will compile the java
code and create an artifact

10 Apply-->Save

POLLSCM
------------
This is a feature in jenkins using which we can integrate jenkins with version
controlling system like git so that whenever developers make any changes to the
code in git immediately jenkins will be notified and jenkins can trigger all the
steps of CI-CD

1 Open the dashboard of jenkins--->Go to the development job--->click on


Configure

2 Go to build triggers section and click on POLL SCM

6 In the Schedule tab


* * * * *

7 Apply--->Save

Stage 3(Continuous Deployment)


The artifact created in the previous step should now be copied into the
application servers running on QA environment.These application servers can be
tomcat,jboss etc.

Downloading/Setup Tomcat
---------------------------
1 Open https://tomcat.apache.org/download-70.cgi
2 Go to "Binary Distributions" and download the zip file
3 Extract it and open it
4 Since jenkins and tomcat are currently running on the same machine and since both
of them use the same 8080 port no it will create a conflict.So to change the port
number of tomcat

5 Open the tomcat that we downloaded-->Open conf folder


Open server.xml file--->Search fo Connector port
and change it from 8080 to 8899

6 Jenkins resuires username and password access to deploy into tomcat---->Open


tomcat-users.xml file in the conf folder--->add the below statement
<user username="admin" password="admin" roles="manager-
script"/>
7 Open bin folder in tomcat and click on startup.bat file

8 To access tomcat
Open any browser(localhost:8899)

For performing continuous deployment


------------------------------------
1 Open the dashboard of jenkins-->manage jenkins
2 Manage plugins-->Click on available tab
3 Search for "Deploy to container" plugin-->Install it
4 Go back to the dashboard
5 Go to the Development job that we created--->Configure
6 Click on Post build actions-->Add post build action
7 Click on Deploy war/ear to container
8

Stage 4(Continuous Testing)


In this stage jenkins should download the selenium automation testing
programs created by the testers and run them on the application that was deployed
into qa servers in the previous stage

1 Open the dashboard of jenkins


2 Click on New item--->enter item name as "Testing"
3 Select free stlye project-->OK
4 Go to Source Code management--->Select Git
5 Enter the github url provided by testing team
https://github.com/seleniusaikrishna/FunctionalTesting.git
6 Go to Build section-->Click on Add build step
7 Click on Execute windows batch command(Execute shell if it is a linux machine)
8 java -jar testing.jar
9 Apply--->Save

Linking Development job and Testing job


------------------------------------------
Development job should be linked with testing job so that they are automatically
executed one after other.
1 Go to dashboard of jenkins
2 Go to Development job--->Click on Configure
3 Go to post build actions--->add post build actions
4 Click on Build other project--->enter project name as
"Testing"--->apply--->save

Вам также может понравиться