Build PHP Application With Jenkins

This tutorial help to create Building a PHP Project in Jenkins.We will go through process of CI(Continuous Integration) for PHP.
I believe, You have gone gone through the installation of Jenkins plugin on the system.

Let’s taking one step ahead and create a job/item in Jenkins for our PHP project. I am creating project for PHP. PHP is interpreted language So don’t need any compiler to create build jar/exe file. We just copy files from our work-space to production /var/www/ folder.

I am assuming you have created your build and config file of your PHP project and mentioned source and target location of your file into config.xml file.This is very simple article which help to understand functionality of creating job in Jenkins and how’s set job parameters, I am not using any version control like SVN/GIT.

I am using Apache Ant for create build on server.You don’t have Apache Ant on your jenkins server yet. You can install using below command on linux and for windows you can refer this article

sudo apt-get install ant

Create and Build PHP project in Jenkins

Step 1: Click New Item option from left-hand sidebar menu.

Step 2: Write your Job Name ex-PHPbuild and select Free style project.
itemname

Step 3: Select Source Code management NONE.
source_code

Step 4: Choose Invoke ANT under Build Environment.

Step 5: Select 'ANT' profile from Invoke ANT dropdown.
invoke_ent

This dropdown has your ant profile which you have installed on your system, if you do not have any please write down a ant profile name and select Install automatically ant.

Step 6: Save your job.

Step 7: Go to your Jenkins dashboard and select your job PHPbuild.

Step 8: Clicked Build Now link.

build-now

Now you can see your build under build history, if the circle color is blue that means your have created successfully build otherwise color will be red – Your build end with error. You can see you error message using console output.

One thought on “Build PHP Application With Jenkins

Leave a Reply

Your email address will not be published.