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.
Step 3: Select Source Code management NONE.
Step 4: Choose Invoke ANT under Build Environment.
Step 5: Select 'ANT'
profile from Invoke ANT dropdown.
Step 6: Save your job.
Step 7: Go to your Jenkins dashboard and select your job PHPbuild.
Step 8: Clicked Build Now link.
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.
Thanks! 🙂