From 08d2ded0885f68382cf57df5e16c22b731ca225f Mon Sep 17 00:00:00 2001 From: Heinz Wiesinger Date: Thu, 11 Jul 2024 15:49:52 +0200 Subject: [PATCH] CI: Remove Jenkinsfile --- .editorconfig | 2 +- Jenkinsfile | 156 -------------------------------------------------- 2 files changed, 1 insertion(+), 157 deletions(-) delete mode 100644 Jenkinsfile diff --git a/.editorconfig b/.editorconfig index d038605..22c9bad 100644 --- a/.editorconfig +++ b/.editorconfig @@ -23,6 +23,6 @@ indent_size = 2 [{*.md,*.txt}] indent_style = space -[{Jenkinsfile,*.xml,*.json,*.neon.dist,*.jq,*.yml}] +[{*.xml,*.json,*.neon.dist,*.jq,*.yml}] indent_style = space indent_size = 4 diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 7023bf7..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,156 +0,0 @@ -#!groovy - -/* - * SPDX-FileCopyrightText: Copyright 2016 M2mobi B.V., Amsterdam, The Netherlands - * SPDX-FileCopyrightText: Copyright 2022 Move Agency Group B.V., Zwolle, The Netherlands - * SPDX-License-Identifier: CC0-1.0 - */ - -def ant_sh(String stage){ - sh "/bin/ant ${stage}" -} -def deploy(){ - if(env.deploy){ - sh "salt-connect library project=lunr branch=master env=m2mobi" - } -} -def dependencies(String dependency_tool){ - try { - sh "${dependency_tool} install" - } catch(error){ - echo "WARNING: Couldn't setup dependencies!" - } -} -pipeline { - agent { - label "web" - } - - - stages { - stage('Checkout'){ - steps{ - checkout changelog: false, poll: false, scm: - [ - $class: 'GitSCM', - branches: [[name: 'master']], - doGenerateSubmoduleConfigurations: false, - extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: '../lunr-coding-standard']], - submoduleCfg: [], - userRemoteConfigs: [[url: 'https://github.com/lunr-php/lunr-coding-standard.git']] - ] - checkout scm - } - } - - stage('Clean'){ - steps{ - ant_sh('clean') - dependencies(env.dependency_tool) - ant_sh('pdepend') - } - post { - always { - publishHTML([ - reportName: 'PDepend Reports', - reportDir: 'build/pdepend', - alwaysLinkToLastBuild: true, - reportFiles: '', - keepAll: true, - allowMissing: false - ]) - } - } - } - - stage('Code inspection'){ - steps{ - parallel ( - cpd: { ant_sh('phpcpd') }, - cs: { ant_sh('phpcs') }, - stan: { ant_sh('phpstan-ci') }, - loc: { ant_sh('phploc') } - ) - } - post { - always { - recordIssues enabledForFailure: true, tool: cpd(pattern: 'build/logs/pmd-cpd.xml') - recordIssues enabledForFailure: true, tool: phpStan(pattern: 'build/logs/phpstan.xml') - recordIssues enabledForFailure: true, tool: checkStyle(pattern: 'build/logs/checkstyle.xml'), qualityGates: [[threshold: 999, type: 'TOTAL', unstable: true]] - } - } - } - - stage('Unit tests'){ - steps{ - ant_sh('phpunit') - } - post { - success { - junit 'build/logs/junit.xml' - recordIssues enabledForFailure: true, tool: junitParser(pattern: 'build/logs/junit.xml') - step([ - $class: 'CloverPublisher', - cloverReportDir: 'build/logs', - cloverReportFileName: 'clover.xml', - healthyTarget: [methodCoverage: 70, conditionalCoverage: 80, statementCoverage: 80], - unhealthyTarget: [methodCoverage: 50, conditionalCoverage: 60, statementCoverage: 60], - failingTarget: [methodCoverage: 30, conditionalCoverage: 40, statementCoverage: 40] - ]) - publishHTML([ - reportName: 'Coverage Reports', - reportDir: 'build/coverage', - reportFiles: 'index.html', - alwaysLinkToLastBuild: true, - keepAll: true, - allowMissing: false - ]) - } - } - } - - stage('SonarQube Analysis'){ - when { - branch 'master' - } - environment { - ACCOUNT_KEY = null - PROJECT_SLUG = null - } - steps{ - script { - ACCOUNT_KEY = GIT_URL.tokenize('/')[2] - PROJECT_SLUG_W_GIT = GIT_URL.tokenize('/')[3] - PROJECT_SLUG = PROJECT_SLUG_W_GIT.substring(0, PROJECT_SLUG_W_GIT.lastIndexOf('.')) - } - withSonarQubeEnv('M2mobi') { - sh """sonar-scanner \\ - -Dsonar.projectKey=${ACCOUNT_KEY}:backend:${PROJECT_SLUG} \\ - -Dsonar.projectName=Lunr.Config \\ - -Dsonar.sources=src/ \\ - -Dsonar.php.tests.reportPath=build/logs/junit.xml \\ - -Dsonar.php.coverage.reportPaths=build/logs/clover.xml""" - sh "./tests/get-sonar-report.sh ${ACCOUNT_KEY}:backend:${PROJECT_SLUG}" - } - } - post { - always { - recordIssues enabledForFailure: true, tool: sonarQube(pattern: 'build/logs/sonar-report.json') - } - } - } - } - - post { - success { - deploy() - } - failure { - emailext body: 'Please go to $BUILD_URL to see the result.', - recipientProviders: [[$class: 'RequesterRecipientProvider'], [$class: 'CulpritsRecipientProvider']], - subject: '$JOB_NAME ($JOB_BASE_NAME): Build $BUILD_DISPLAY_NAME: FAILED', - to: '${ENV,var="LUNR_MAILINGLIST"}' - } - } - -}