Changeset - 15a12f2a47b4
[Not reviewed]
default
0 1 0
domruf - 9 years ago 2017-03-24 20:15:07
dominikruf@gmail.com
jenkinsfile: delete all old files in the workspace

Especial important when files have been renamed and there are *.pyc files
left over from the last build.
1 file changed with 4 insertions and 0 deletions:
0 comments (0 inline, 0 general)
Jenkinsfile
Show inline comments
 
@@ -55,24 +55,25 @@ node {
 
        archiveArtifacts 'pylint.out'
 
        try {
 
            step([$class: 'WarningsPublisher', canComputeNew: false, canResolveRelativePaths: false, defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', messagesPattern: '', parserConfigurations: [[parserName: 'PyLint', pattern: 'pylint.out']], unHealthy: ''])
 
        } 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 {
 
            deleteDir()
 
            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'
 
@@ -80,70 +81,73 @@ node {
 
            try {
 
                step([$class: 'CoberturaPublisher', autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: 'coverage.xml', failNoReports: false, failUnhealthy: false, failUnstable: false, maxNumberOfBuilds: 0, onlyStable: false, zoomCoverageChart: false])
 
            } 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 {
 
                deleteDir()
 
                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
 
                        """, returnStatus: true
 
                }
 
                sh 'sed --in-place "s/\\(classname=[\'\\"]\\)/\\1DE./g" pytest_de.xml'
 
                archiveArtifacts 'pytest_de.xml'
 
                junit 'pytest_de.xml'
 
            }
 
        }
 
        pytests['mysql'] = {
 
            ws {
 
                deleteDir()
 
                unstash name: 'kallithea'
 
                sh """$activatevirtualenv
 
                    pip install --upgrade MySQL-python
 
                    """
 
                withEnv(['TEST_DB=mysql://kallithea:kallithea@jenkins_mysql/kallithea_test?charset=utf8']) {
 
                    if (isUnix()) {
 
                        sh script: """$activatevirtualenv
 
                            py.test -p no:sugar --cov-config .coveragerc --junit-xml=pytest_mysql.xml --cov=kallithea --cov-report xml
 
                            """, returnStatus: true
 
                    } else {
 
                        bat script: """$activatevirtualenv
 
                            py.test -p no:sugar --cov-config .coveragerc --junit-xml=pytest_mysql.xml --cov=kallithea --cov-report xml
 
                            """, returnStatus: true
 
                    }
 
                }
 
                sh 'sed --in-place "s/\\(classname=[\'\\"]\\)/\\1MYSQL./g" pytest_mysql.xml'
 
                archiveArtifacts 'pytest_mysql.xml'
 
                junit 'pytest_mysql.xml'
 
            }
 
        }
 
        pytests['postgresql'] = {
 
            ws {
 
                deleteDir()
 
                unstash name: 'kallithea'
 
                sh """$activatevirtualenv
 
                    pip install --upgrade psycopg2
 
                    """
 
                withEnv(['TEST_DB=postgresql://kallithea:kallithea@jenkins_postgresql/kallithea_test']) {
 
                    if (isUnix()) {
 
                        sh script: """$activatevirtualenv
 
                            py.test -p no:sugar --cov-config .coveragerc --junit-xml=pytest_postgresql.xml --cov=kallithea --cov-report xml
 
                            """, returnStatus: true
 
                    } else {
 
                        bat script: """$activatevirtualenv
 
                            py.test -p no:sugar --cov-config .coveragerc --junit-xml=pytest_postgresql.xml --cov=kallithea --cov-report xml
0 comments (0 inline, 0 general)