├── build.xml ├── build ├── .gitignore ├── phpcs.xml ├── phpdox.xml └── phpmd.xml ├── config.xml ├── phpunit.xml.dist └── readme.md /build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 12 | 13 | 15 | 16 | 18 | 19 | 21 | 22 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | Cleaning out the build artifacts 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | Installing dependencies 69 | 70 | 71 | 72 | 73 | 74 | 75 | Updating dependencies 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | Making the build artifact folders 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | -------------------------------------------------------------------------------- /build/.gitignore: -------------------------------------------------------------------------------- 1 | api/ 2 | code-browser/ 3 | coverage/ 4 | logs/ 5 | pdepend/ -------------------------------------------------------------------------------- /build/phpcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /build/phpdox.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /build/phpmd.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <img type="image/svg+xml" height="300" src="ws/build/pdepend/overview-pyramid.svg" width="500"></img> 5 | <img type="image/svg+xml" height="300" src="ws/build/pdepend/dependencies.svg" width="500"></img> 6 | false 7 | 8 | 9 | 2 10 | 11 | 12 | 13 | 14 | /var/www/laravel 15 | 16 | 17 | 18 | 19 | ** 20 | 21 | 22 | false 23 | false 24 | false 25 | false 26 | false 27 | false 28 | false 29 | false 30 | false 31 | false 32 | 33 | Default 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | false 42 | 43 | 44 | 45 | true 46 | false 47 | false 48 | false 49 | 50 | 51 | 52 | 53 | 54 | false 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | low 65 | [CHECKSTYLE] 66 | 67 | true 68 | false 69 | false 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | false 89 | false 90 | false 91 | build/logs/checkstyle.xml 92 | 93 | 94 | 95 | 96 | low 97 | [PMD] 98 | 99 | true 100 | false 101 | false 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | false 121 | false 122 | true 123 | build/logs/pmd.xml 124 | 125 | 126 | 127 | 128 | low 129 | [DRY] 130 | 131 | true 132 | false 133 | false 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | false 153 | false 154 | false 155 | build/logs/pmd-cpd.xml 156 | 50 157 | 25 158 | 159 | 160 | 161 | 162 | A - Lines of code 163 | Lines of Code 164 | 165 | 166 | build/logs/phploc.csv 167 | 168 | csv 169 | 170 | Lines of Code (LOC) 171 | Comment Lines of Code (CLOC) 172 | Non-Comment Lines of Code (NCLOC) 173 | 174 | INCLUDE_BY_STRING 175 | Lines of Code (LOC),Comment Lines of Code (CLOC),Non-Comment Lines of Code (NCLOC) 176 | 177 | false 178 | 179 | 180 | phploc 181 | 100 182 | 123.csv 183 | 0 184 | 185 | false 186 | 187 | 188 | B - Structures 189 | Count 190 | 191 | 192 | build/logs/phploc.csv 193 | 194 | csv 195 | 196 | Functions 197 | Classes 198 | Namespaces 199 | Files 200 | Directories 201 | Methods 202 | Interfaces 203 | Constants 204 | Anonymous Functions 205 | 206 | INCLUDE_BY_STRING 207 | Directories,Files,Namespaces,Interfaces,Classes,Methods,Functions,Anonymous Functions,Constants 208 | 209 | false 210 | 211 | 212 | phploc 213 | 100 214 | 1107599928.csv 215 | 0 216 | 217 | false 218 | 219 | 220 | G - Average Length 221 | Average Non-Comment Lines of Code 222 | 223 | 224 | build/logs/phploc.csv 225 | 226 | csv 227 | 228 | Average Method Length (NCLOC) 229 | Average Class Length (NCLOC) 230 | 231 | INCLUDE_BY_STRING 232 | Average Class Length (NCLOC),Average Method Length (NCLOC) 233 | 234 | false 235 | 236 | 237 | phploc 238 | 100 239 | 523405415.csv 240 | 0 241 | 242 | false 243 | 244 | 245 | H - Relative Cyclomatic Complexity 246 | Cyclomatic Complexity by Structure 247 | 248 | 249 | build/logs/phploc.csv 250 | 251 | csv 252 | 253 | Cyclomatic Complexity / Lines of Code 254 | Cyclomatic Complexity / Number of Methods 255 | 256 | INCLUDE_BY_STRING 257 | Cyclomatic Complexity / Lines of Code,Cyclomatic Complexity / Number of Methods 258 | 259 | false 260 | 261 | 262 | phploc 263 | 100 264 | 186376189.csv 265 | 0 266 | 267 | false 268 | 269 | 270 | D - Types of Classes 271 | Count 272 | 273 | 274 | build/logs/phploc.csv 275 | 276 | csv 277 | 278 | Abstract Classes 279 | Classes 280 | Concrete Classes 281 | 282 | INCLUDE_BY_STRING 283 | Classes,Abstract Classes,Concrete Classes 284 | 285 | false 286 | 287 | 288 | phploc 289 | 100 290 | 594356163.csv 291 | 0 292 | 293 | false 294 | 295 | 296 | E - Types of Methods 297 | Count 298 | 299 | 300 | build/logs/phploc.csv 301 | 302 | csv 303 | 304 | Methods 305 | Static Methods 306 | Non-Static Methods 307 | Public Methods 308 | Non-Public Methods 309 | 310 | INCLUDE_BY_STRING 311 | Methods,Non-Static Methods,Static Methods,Public Methods,Non-Public Methods 312 | 313 | false 314 | 315 | 316 | phploc 317 | 100 318 | 1019987862.csv 319 | 0 320 | 321 | false 322 | 323 | 324 | F - Types of Constants 325 | Count 326 | 327 | 328 | build/logs/phploc.csv 329 | 330 | csv 331 | 332 | Class Constants 333 | Global Constants 334 | Constants 335 | 336 | INCLUDE_BY_STRING 337 | Constants,Global Constants,Class Constants 338 | 339 | false 340 | 341 | 342 | phploc 343 | 100 344 | 217648577.csv 345 | 0 346 | 347 | false 348 | 349 | 350 | C - Testing 351 | Count 352 | 353 | 354 | build/logs/phploc.csv 355 | 356 | csv 357 | 358 | Functions 359 | Classes 360 | Methods 361 | Test Clases 362 | Test Methods 363 | 364 | INCLUDE_BY_STRING 365 | Classes,Methods,Functions,Test Clases,Test Methods 366 | 367 | false 368 | 369 | 370 | phploc 371 | 100 372 | 174807245.csv 373 | 0 374 | 375 | false 376 | 377 | 378 | 379 | 380 | true 381 | build/coverage 382 | build/logs/clover.xml 383 | false 384 | 385 | 70 386 | 80 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | Code Browser 395 | build/code-browser 396 | index.html 397 | true 398 | htmlpublisher-wrapper.html 399 | 400 | 401 | 402 | 403 | 404 | 405 | build/logs/junit.xml 406 | true 407 | true 408 | true 409 | 410 | 411 | 412 | 413 | 0 414 | 0 415 | 0 416 | 0 417 | 418 | 419 | 0 420 | 0 421 | 0 422 | 0 423 | 424 | 425 | 1 426 | 427 | 428 | build/logs/jdepend.xml 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | checkstyle 439 | 440 | checkstyle 441 | 10 442 | 999 443 | 999 444 | false 445 | build/logs/checkstyle.xml 446 | 447 | 448 | 449 | codenarc 450 | 451 | codenarc 452 | 10 453 | 999 454 | 999 455 | false 456 | 457 | 458 | 459 | 460 | cpd 461 | 462 | cpd 463 | 10 464 | 999 465 | 999 466 | false 467 | build/logs/pmd-cpd.xml 468 | 469 | 470 | 471 | cpplint 472 | 473 | cpplint 474 | 10 475 | 999 476 | 999 477 | false 478 | 479 | 480 | 481 | 482 | csslint 483 | 484 | csslint 485 | 10 486 | 999 487 | 999 488 | false 489 | 490 | 491 | 492 | 493 | findbugs 494 | 495 | findbugs 496 | 10 497 | 999 498 | 999 499 | false 500 | 501 | 502 | 503 | 504 | fxcop 505 | 506 | fxcop 507 | 10 508 | 999 509 | 999 510 | false 511 | 512 | 513 | 514 | 515 | gendarme 516 | 517 | gendarme 518 | 10 519 | 999 520 | 999 521 | false 522 | 523 | 524 | 525 | 526 | jcreport 527 | 528 | jcreport 529 | 10 530 | 999 531 | 999 532 | false 533 | 534 | 535 | 536 | 537 | jslint 538 | 539 | jslint 540 | 10 541 | 999 542 | 999 543 | false 544 | 545 | 546 | 547 | 548 | pep8 549 | 550 | pep8 551 | 10 552 | 999 553 | 999 554 | false 555 | 556 | 557 | 558 | 559 | perlcritic 560 | 561 | perlcritic 562 | 10 563 | 999 564 | 999 565 | false 566 | 567 | 568 | 569 | 570 | pmd 571 | 572 | pmd 573 | 10 574 | 999 575 | 999 576 | false 577 | build/logs/pmd.xml 578 | 579 | 580 | 581 | pylint 582 | 583 | pylint 584 | 10 585 | 999 586 | 999 587 | false 588 | 589 | 590 | 591 | 592 | simian 593 | 594 | simian 595 | 10 596 | 999 597 | 999 598 | false 599 | 600 | 601 | 602 | 603 | stylecop 604 | 605 | stylecop 606 | 10 607 | 999 608 | 999 609 | false 610 | 611 | 612 | 613 | 614 | 100 615 | 616 | 617 | default 618 | 619 | 620 | 621 | 622 | -------------------------------------------------------------------------------- /phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | ./tests/ 16 | 17 | 18 | 19 | 20 | ./src/ 21 | 22 | 23 | 24 | 27 | 28 | 30 | 31 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # php-jenkins 2 | 3 | Boilerplate for setting up continuous integration of PHP applications using [Jenkins](http://www.jenkins-ci.org). 4 | 5 | ## Installation / setup 6 | 7 | Clone or [download](https://github.com/modess/php-jenkins/archive/master.zip) the files and directories, and add them to your repository. 8 | 9 | Configure your source and test directories in: 10 | 11 | **build.xml** 12 | ``` 13 | [...] 14 | 15 | [...] 16 | ``` 17 | 18 | **phpunit.xml.dist** 19 | ``` 20 | [...] 21 | ./tests/ 22 | [...] 23 | ./src/ 24 | [...] 25 | ``` 26 | 27 | **build/phpdox.xml** 28 | ``` 29 | [...] 30 | 31 | [...] 32 | ``` 33 | 34 | ## Build Targets 35 | Here are the list of build targets that are defined within the build.xml: 36 | 37 | * **build** *(DEFAULT)* 38 | * **build-clean** 39 | * **build-parallel** 40 | * **build-parallel-clean** 41 | * **build-common** 42 | * **tools-parallel** - Run tools in parallel 43 | * **clean** - Cleanup build and composer artifacts 44 | * **clean-build** - Cleanup build artifacts 45 | * **clean-composer** - Cleanup composer artifacts 46 | * **composer** - Install or update dependencies 47 | * **composer.check** 48 | * **composer-install** - Installing dependencies 49 | * **composer-update** - Updating dependencies 50 | * **lint** - Perform syntax check of sourcecode files 51 | * **pdepend** - Calculate software metrics using PHP_Depend 52 | * **phpcb** - Aggregate tool output with PHP_CodeBrowser 53 | * **phpcpd** - Find duplicate code using PHPCPD 54 | * **phpcs** - Find coding standard violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing 55 | * **phpcs-ci** - Find coding standard violations using PHP_CodeSniffer creating a log file for the continuous integration server 56 | * **phpdox** - Generate API documentation using phpDox 57 | * **phploc** - Measure project size using PHPLOC 58 | * **phpmd** - Perform project mess detection using PHPMD and print human readable output. Intended for usage on the command line before committing. 59 | * **phpmd-ci** - Perform project mess detection using PHPMD creating a log file for the continuous integration server 60 | * **phpunit** - Run unit tests with PHPUnit 61 | * **prepare** - Prepare for build 62 | 63 | ### References 64 | 65 | This boilerplate comes from glueing together a collection of post on the internet 66 | 67 | * [https://modess.io/continuous-integration-for-laravel-with-jenkins-and-git/](https://modess.io/continuous-integration-for-laravel-with-jenkins-and-git/) 68 | * [http://chris.schalenborgh.be/2013/04/05/deploy-php-projects-jenkins-os/](http://chris.schalenborgh.be/2013/04/05/deploy-php-projects-jenkins-os/) 69 | --------------------------------------------------------------------------------