Home
DevCentral
Search
Configure Global Search
Log In
Transactions
T1637
Change Details
Change Details
Old
New
Diff
For the notifications center development (rNOTIF), we were happy with a Jenkins PHP template prepared by Sebastian Bergmann (phpunit). The main feature we used were the phpunit tests, phpcs and the code coverage. http://jenkins-php.org/ A lot of those components aren't maintained anymore at Jenkins level and marked as deprecated. A lot of them are now a part of the [[ https://plugins.jenkins.io/warnings-ng/ | Jenkins Warnings Plugin ]]: > "The Jenkins Next Generation Warnings plug-in replaces the whole Jenkins Static Analysis Suite. I.e. it makes the following Jenkins plugins obsolete: Android Lint, CheckStyle, Dry, FindBugs, PMD, Warnings, Static Analysis Utilities, Static Analysis Collector." Meanwhile, some tools we use and consider important, like phan, aren't called in CI. A new PHP template would so be helpful. The expected format is a modern Jenkinsfile pipeline. **Plugins used in legacy template** | **Plugin** | **Role** | **Status** | **Alternative plan** | | Checkstyle | processing PHP_CodeSniffer logfiles in Checkstyle format | deprecated | phpcs can be run without dedicated plugin, but it's also now a part of the [[ https://plugins.jenkins.io/warnings-ng/ | Jenkins Warnings Plugin ]] | | Clover PHP | processing PHPUnit's Clover XML logfile | OK | keep it to offer a test coverage dashboard | | Crap4J | processing PHPUnit's Crap4J XML logfile | OK| ? | | DRY | processing phpcpd logfiles in PMD-CPD format | deprecated | Now a part of the [[ https://plugins.jenkins.io/warnings-ng/ | Jenkins Warnings Plugin ]] | | HTML Publisher | publishing documentation generated by phpDox, for instance | deprecated | //not needed// | | JDepend | processing PHP_Depend logfiles in JDepend format | OK | ? | | Plot | processing phploc CSV output | OK | ? | | PMD | processing PHPMD logfiles in PMD format | deprecated | Now a part of the [[ https://plugins.jenkins.io/warnings-ng/ | Jenkins Warnings Plugin ]] | | Violations | processing various logfiles | deprecated | can be implemented by the [[ https://plugins.jenkins.io/warnings-ng/ | Jenkins Warnings Plugin ]] | | Warnings | processing PHP compiler warnings in the console log | deprecated | Superseded by the [[ https://plugins.jenkins.io/warnings-ng/ | Jenkins Warnings Plugin ]] | | xUnit | processing PHPUnit's JUnit XML logfile | OK| Keep, and migrate to pipelines | **Example of how to use the warnings plugin** There is an integrated mode where we can run through Maven a script pretty similar to the current XML we use to define jobs, collect results with scanForIssues and then publish them with publishIssues: ```name=Jenkinsfile,lang=groovy node { ... stage('Analysis') { def mvnHome = tool 'mvn-default' sh "${mvnHome}/bin/mvn --batch-mode -V -U -e checkstyle:checkstyle pmd:pmd pmd:cpd" def checkstyle = scanForIssues tool: checkStyle(pattern: '**/target/checkstyle-result.xml') publishIssues issues: [checkstyle] def pmd = scanForIssues tool: pmdParser(pattern: '**/target/pmd.xml') publishIssues issues: [pmd] def cpd = scanForIssues tool: cpd(pattern: '**/target/cpd.xml') publishIssues issues: [cpd] def maven = scanForIssues tool: mavenConsole() publishIssues issues: [maven] publishIssues id: 'analysis', name: 'All Issues', issues: [checkstyle, pmd], filters: [includePackage('io.jenkins.plugins.analysis.*')] } ... } ``` **Example of how to use the xunit plugin** Declarative pipeline format: ```name=Jenkinsfile,lang=groovy pipeline { agent any stages { stage('Test'){ steps { sh "run_tests.bash" } } } post { always{ xunit ( thresholds: [ skipped(failureThreshold: '0'), failed(failureThreshold: '0') ], tools: [ BoostTest(pattern: 'boost/*.xml') ]) ) } } } ```
For the notifications center development (rNOTIF), we were happy with a Jenkins PHP template prepared by Sebastian Bergmann (phpunit). The main feature we used were the phpunit tests, phpcs and the code coverage. http://jenkins-php.org/ A lot of those components aren't maintained anymore at Jenkins level and marked as deprecated. A lot of them are now a part of the [[ https://plugins.jenkins.io/warnings-ng/ | Jenkins Warnings Plugin ]]: > "The Jenkins Next Generation Warnings plug-in replaces the whole Jenkins Static Analysis Suite. I.e. it makes the following Jenkins plugins obsolete: Android Lint, CheckStyle, Dry, FindBugs, PMD, Warnings, Static Analysis Utilities, Static Analysis Collector." Meanwhile, some tools we use and consider important, like phan, aren't called in CI. A new PHP template would so be helpful. The expected format is a modern Jenkinsfile pipeline. **Plugins used in legacy template** | **Plugin** | **Role** | **Status** | **Alternative plan** | | Checkstyle | processing PHP_CodeSniffer logfiles in Checkstyle format | deprecated | phpcs can be run without dedicated plugin, but it's also now a part of the [[ https://plugins.jenkins.io/warnings-ng/ | Jenkins Warnings Plugin ]] | | Clover PHP | processing PHPUnit's Clover XML logfile | OK | keep it to offer a test coverage dashboard | | Crap4J | processing PHPUnit's Crap4J XML logfile | OK| ? | | DRY | processing phpcpd logfiles in PMD-CPD format | deprecated | Now a part of the [[ https://plugins.jenkins.io/warnings-ng/ | Jenkins Warnings Plugin ]] | | HTML Publisher | publishing documentation generated by phpDox, for instance | OK| //not needed// | | JDepend | processing PHP_Depend logfiles in JDepend format | OK | ? | | Plot | processing phploc CSV output | OK | ? | | PMD | processing PHPMD logfiles in PMD format | deprecated | Now a part of the [[ https://plugins.jenkins.io/warnings-ng/ | Jenkins Warnings Plugin ]] | | Violations | processing various logfiles | deprecated | can be implemented by the [[ https://plugins.jenkins.io/warnings-ng/ | Jenkins Warnings Plugin ]] | | Warnings | processing PHP compiler warnings in the console log | deprecated | Superseded by the [[ https://plugins.jenkins.io/warnings-ng/ | Jenkins Warnings Plugin ]] | | xUnit | processing PHPUnit's JUnit XML logfile | OK| Keep, and migrate to pipelines | **Example of how to use the warnings plugin** There is an integrated mode where we can run through Maven a script pretty similar to the current XML we use to define jobs, collect results with scanForIssues and then publish them with publishIssues: ```name=Jenkinsfile,lang=groovy node { ... stage('Analysis') { def mvnHome = tool 'mvn-default' sh "${mvnHome}/bin/mvn --batch-mode -V -U -e checkstyle:checkstyle pmd:pmd pmd:cpd" def checkstyle = scanForIssues tool: checkStyle(pattern: '**/target/checkstyle-result.xml') publishIssues issues: [checkstyle] def pmd = scanForIssues tool: pmdParser(pattern: '**/target/pmd.xml') publishIssues issues: [pmd] def cpd = scanForIssues tool: cpd(pattern: '**/target/cpd.xml') publishIssues issues: [cpd] def maven = scanForIssues tool: mavenConsole() publishIssues issues: [maven] publishIssues id: 'analysis', name: 'All Issues', issues: [checkstyle, pmd], filters: [includePackage('io.jenkins.plugins.analysis.*')] } ... } ``` **Example of how to use the xunit plugin** Declarative pipeline format: ```name=Jenkinsfile,lang=groovy pipeline { agent any stages { stage('Test'){ steps { sh "run_tests.bash" } } } post { always{ xunit ( thresholds: [ skipped(failureThreshold: '0'), failed(failureThreshold: '0') ], tools: [ BoostTest(pattern: 'boost/*.xml') ]) ) } } } ``` **Example of how to use the HTML Publisher plugin** This plugin has [[ https://www.jenkins.io/doc/pipeline/steps/htmlpublisher/ | some documented advanced syntax features ]]. Like we do for Rust, we can create a Documentation step with a `sh` call to phpDox, then this content: ```lang=groovy publishHTML (target : [ allowMissing: false, alwaysLinkToLastBuild: true, keepAll: true, reportDir: 'reports', reportFiles: 'myreport.html', reportName: 'My Reports', reportTitles: 'The Report']) ```
For the notifications center development (rNOTIF), we were happy with a Jenkins PHP template prepared by Sebastian Bergmann (phpunit). The main feature we used were the phpunit tests, phpcs and the code coverage. http://jenkins-php.org/ A lot of those components aren't maintained anymore at Jenkins level and marked as deprecated. A lot of them are now a part of the [[ https://plugins.jenkins.io/warnings-ng/ | Jenkins Warnings Plugin ]]: > "The Jenkins Next Generation Warnings plug-in replaces the whole Jenkins Static Analysis Suite. I.e. it makes the following Jenkins plugins obsolete: Android Lint, CheckStyle, Dry, FindBugs, PMD, Warnings, Static Analysis Utilities, Static Analysis Collector." Meanwhile, some tools we use and consider important, like phan, aren't called in CI. A new PHP template would so be helpful. The expected format is a modern Jenkinsfile pipeline. **Plugins used in legacy template** | **Plugin** | **Role** | **Status** | **Alternative plan** | | Checkstyle | processing PHP_CodeSniffer logfiles in Checkstyle format | deprecated | phpcs can be run without dedicated plugin, but it's also now a part of the [[ https://plugins.jenkins.io/warnings-ng/ | Jenkins Warnings Plugin ]] | | Clover PHP | processing PHPUnit's Clover XML logfile | OK | keep it to offer a test coverage dashboard | | Crap4J | processing PHPUnit's Crap4J XML logfile | OK| ? | | DRY | processing phpcpd logfiles in PMD-CPD format | deprecated | Now a part of the [[ https://plugins.jenkins.io/warnings-ng/ | Jenkins Warnings Plugin ]] | | HTML Publisher | publishing documentation generated by phpDox, for instance |
deprecated
OK
| //not needed// | | JDepend | processing PHP_Depend logfiles in JDepend format | OK | ? | | Plot | processing phploc CSV output | OK | ? | | PMD | processing PHPMD logfiles in PMD format | deprecated | Now a part of the [[ https://plugins.jenkins.io/warnings-ng/ | Jenkins Warnings Plugin ]] | | Violations | processing various logfiles | deprecated | can be implemented by the [[ https://plugins.jenkins.io/warnings-ng/ | Jenkins Warnings Plugin ]] | | Warnings | processing PHP compiler warnings in the console log | deprecated | Superseded by the [[ https://plugins.jenkins.io/warnings-ng/ | Jenkins Warnings Plugin ]] | | xUnit | processing PHPUnit's JUnit XML logfile | OK| Keep, and migrate to pipelines | **Example of how to use the warnings plugin** There is an integrated mode where we can run through Maven a script pretty similar to the current XML we use to define jobs, collect results with scanForIssues and then publish them with publishIssues: ```name=Jenkinsfile,lang=groovy node { ... stage('Analysis') { def mvnHome = tool 'mvn-default' sh "${mvnHome}/bin/mvn --batch-mode -V -U -e checkstyle:checkstyle pmd:pmd pmd:cpd" def checkstyle = scanForIssues tool: checkStyle(pattern: '**/target/checkstyle-result.xml') publishIssues issues: [checkstyle] def pmd = scanForIssues tool: pmdParser(pattern: '**/target/pmd.xml') publishIssues issues: [pmd] def cpd = scanForIssues tool: cpd(pattern: '**/target/cpd.xml') publishIssues issues: [cpd] def maven = scanForIssues tool: mavenConsole() publishIssues issues: [maven] publishIssues id: 'analysis', name: 'All Issues', issues: [checkstyle, pmd], filters: [includePackage('io.jenkins.plugins.analysis.*')] } ... } ``` **Example of how to use the xunit plugin** Declarative pipeline format: ```name=Jenkinsfile,lang=groovy pipeline { agent any stages { stage('Test'){ steps { sh "run_tests.bash" } } } post { always{ xunit ( thresholds: [ skipped(failureThreshold: '0'), failed(failureThreshold: '0') ], tools: [ BoostTest(pattern: 'boost/*.xml') ]) ) } } } ```
**Example of how to use the HTML Publisher plugin** This plugin has [[ https://www.jenkins.io/doc/pipeline/steps/htmlpublisher/ | some documented advanced syntax features ]]. Like we do for Rust, we can create a Documentation step with a `sh` call to phpDox, then this content: ```lang=groovy publishHTML (target : [ allowMissing: false, alwaysLinkToLastBuild: true, keepAll: true, reportDir: 'reports', reportFiles: 'myreport.html', reportName: 'My Reports', reportTitles: 'The Report']) ```
Continue