Skip to content
Snippets Groups Projects
Jenkinsfile 712 B
Newer Older
#!/usr/bin/env groovy

pipeline {
    agent { label 'python3' }
    stages {
        stage('Run unit tests') {
            steps {
                sh 'tox'
                sh 'python3.6 setup.py test -a "--junitxml=junit.xml"'
            }
        }
        stage('Build source distribution') {
            steps {
                // source dist -> dist/setra-client-<version>.tar.gz
                sh 'python3.6 setup.py sdist'
                archiveArtifacts artifacts: 'dist/setra-client-*.tar.gz'
            }
        }
    }
    post {
        always {
            junit '**/junit*.xml'
        }
        cleanup {
            sh 'rm -vf junit.xml'
            sh 'rm -vrf build dist'
        }
    }
}