Using the Job Template

  1. Fetch the jenkins-cli.jar from your jenkins server:

    wget http://localhost:8080/jnlpJars/jenkins-cli.jar
  2. Download and install the job template:

    curl -L https://raw.githubusercontent.com/sebastianbergmann/php-jenkins-template/master/config.xml | \
         java -jar jenkins-cli.jar -s http://localhost:8080 create-job php-template

    or add the template manually:

    cd $JENKINS_HOME/jobs
    mkdir php-template
    cd php-template
    wget https://raw.github.com/sebastianbergmann/php-jenkins-template/master/config.xml
    cd ..
    chown -R jenkins:jenkins php-template/
  3. Reload Jenkins' configuration, for instance using the Jenkins CLI:

    java -jar jenkins-cli.jar -s http://localhost:8080 reload-configuration
  4. Click on "New Job".

  5. Enter a "Job name".

  6. Select "Copy existing job" and enter "php-template" into the "Copy from" field.

  7. Click "OK".

  8. Uncheck the "Disable Build" option.

  9. Fill in your "Source Code Management" information.

  10. Configure a "Build Trigger", for instance "Poll SCM".

  11. Click "Save".

Troubleshooting

No "Copy existing job" option / "php-template" project does not show up

Jenkins cannot find the php-template job. Make sure you cloned to the right directory. Check the permissions to make sure the Jenkins user has read and write access to the directory. Restart Jenkins.

General Setup Issues

Check the management panel http://localhost:8080/manage and the Jenkins log for messages.

HTML Code is shown on the project status page

The default for rendering HTML has been changed in Jenkins 1.553. To correctly display the charts generated by PHP_Depend, you need to enable security on http://localhost/configureSecurity/ and change the Markup Formatter to Raw HTML.