Jenkins: Setup PHP project

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

1. Go to Jenkins URL:

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<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’