Changeset - bc1b11a5d548
[Not reviewed]
default
0 1 0
domruf - 9 years ago 2017-03-15 12:36:43
dominikruf@gmail.com
jenkinsfile: catch the correct exception if jenkins plugin is not available
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
Jenkinsfile
Show inline comments
 
@@ -34,73 +34,73 @@ node {
 
        } else {
 
            bat virtualenvscript
 
        }
 
    }
 
    stage('setup') {
 
        def virtualenvscript = """$activatevirtualenv
 
            pip install --upgrade -e .
 
            pip install -r dev_requirements.txt
 
            python setup.py compile_catalog
 
            """
 
        if (isUnix()) {
 
            sh virtualenvscript
 
        } else {
 
            bat virtualenvscript
 
        }
 
        stash name: 'kallithea', useDefaultExcludes: false
 
    }
 
    stage('pylint') {
 
        sh script: """$activatevirtualenv
 
            pylint -j 0 --disable=C -f parseable kallithea > pylint.out
 
            """, returnStatus: true
 
        archiveArtifacts 'pylint.out'
 
        try {
 
            step([$class: 'WarningsPublisher', canComputeNew: false, canResolveRelativePaths: false, defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', messagesPattern: '', parserConfigurations: [[parserName: 'PyLint', pattern: 'pylint.out']], unHealthy: ''])
 
        } catch (UnsupportedOperationException exc) {
 
        } catch (java.lang.IllegalArgumentException exc) {
 
            echo "You need to install the 'Warnings Plug-in' to display the pylint report."
 
            currentBuild.result = 'UNSTABLE'
 
            echo "Caught: ${exc}"
 
        }
 
    }
 
    def pytests = [:]
 
    pytests['sqlite'] = {
 
        ws {
 
            unstash name: 'kallithea'
 
            if (isUnix()) {
 
                sh script: """$activatevirtualenv
 
                    py.test -p no:sugar --cov-config .coveragerc --junit-xml=pytest_sqlite.xml --cov=kallithea --cov-report xml
 
                    """, returnStatus: true
 
            } else {
 
                bat script: """$activatevirtualenv
 
                    py.test -p no:sugar --cov-config .coveragerc --junit-xml=pytest_sqlite.xml --cov=kallithea --cov-report xml
 
                    """, returnStatus: true
 
            }
 
            sh 'sed --in-place "s/\\(classname=[\'\\"]\\)/\\1SQLITE./g" pytest_sqlite.xml'
 
            archiveArtifacts 'pytest_sqlite.xml'
 
            junit 'pytest_sqlite.xml'
 
            try {
 
                step([$class: 'CoberturaPublisher', autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'coverage.xml', failNoReports: false, failUnhealthy: false, failUnstable: false, maxNumberOfBuilds: 0, onlyStable: false, zoomCoverageChart: false])
 
            } catch (UnsupportedOperationException exc) {
 
            } catch (java.lang.IllegalArgumentException exc) {
 
                echo "You need to install the pipeline compatible 'CoberturaPublisher Plug-in' to display the coverage report."
 
                currentBuild.result = 'UNSTABLE'
 
                echo "Caught: ${exc}"
 
            }
 
        }
 
    }
 
    if (isUnix()) {
 
        pytests['de'] = {
 
            ws {
 
                unstash name: 'kallithea'
 
                withEnv(['LANG=de_DE.UTF-8',
 
                    'LANGUAGE=de',
 
                    'LC_ADDRESS=de_DE.UTF-8',
 
                    'LC_IDENTIFICATION=de_DE.UTF-8',
 
                    'LC_MEASUREMENT=de_DE.UTF-8',
 
                    'LC_MONETARY=de_DE.UTF-8',
 
                    'LC_NAME=de_DE.UTF-8',
 
                    'LC_NUMERIC=de_DE.UTF-8',
 
                    'LC_PAPER=de_DE.UTF-8',
 
                    'LC_TELEPHONE=de_DE.UTF-8',
 
                    'LC_TIME=de_DE.UTF-8',
 
                ]) {
 
                    sh script: """$activatevirtualenv
 
                        py.test -p no:sugar --cov-config .coveragerc --junit-xml=pytest_de.xml --cov=kallithea --cov-report xml
0 comments (0 inline, 0 general)