Jenkins: Setup PHP project

First, you have to create and put code to GitLab.


1. Go to Jenkins URL: http://ztidev.com:8080/jenkins

2. Click ‘New Item’ -> Create ‘Freestyle’ project

Enter project name & Freestyle project

3. In Source Code Management section, add Gitlab URL, usr&pwd

4. In Build section, add following command line:

mkdir -p /var/www/html/<project_name>
cp -rf * /var/www/html/<project_name>
chmod -R 777 /var/www/html/<project_name>
chmod -R 777 /var/www/html/<project_name>/*

6. Click ‘Build Now’ and test on http://ztidev.com:81/<project_name>

7. Send email after build finish.

In Post-build action, select Editable E-mail Notification.

select Advanced Setting…

In Triggers section select Advanced..

Add your email to Recipient List

Click Apply


***********************************************************************

* Make it easy by using ‘auto build & deploy trigger’