change in jenkins

This commit is contained in:
shikhar.s 2019-07-05 19:26:52 +05:30
parent 3156423597
commit 18fbe9629a

60
Jenkinsfile vendored
View File

@ -25,51 +25,57 @@ pipeline {
} }
} }
stage ('Check_style') { // stage ('Check_style') {
steps { // steps {
sh """ // sh """
if [ ! -d venv ] ; then // if [ ! -d venv ] ; then
virtualenv --python=python2.7 venv // virtualenv --python=python2.7 venv
fi // fi
source venv/bin/activate // source venv/bin/activate
export PYTHONPATH="$PWD:$PYTHONPATH" // export PYTHONPATH="$PWD:$PYTHONPATH"
pip install pylint // pip install pylint
cd repo // cd repo
### Need this because some strange control sequences when using default TERM=xterm // ### Need this because some strange control sequences when using default TERM=xterm
export TERM="linux" // export TERM="linux"
## || exit 0 because pylint only exits with 0 if everything is correct // ## || exit 0 because pylint only exits with 0 if everything is correct
pylint --rcfile=pylint.cfg $(find . -maxdepth 1 -name "*.py" -print) MYMODULE/ > pylint.log || exit 0 // pylint --rcfile=pylint.cfg $(find . -maxdepth 1 -name "*.py" -print) MYMODULE/ > pylint.log || exit 0
""" // """
step([$class: 'WarningsPublisher', // step([$class: 'WarningsPublisher',
parserConfigurations: [ // parserConfigurations: [
[ // [
parserName: 'pylint', // parserName: 'pylint',
pattern: 'report/pylint.log' // pattern: 'report/pylint.log'
]], // ]],
unstableTotalAll: '0', // unstableTotalAll: '0',
usePreviousBuildAsReference: true // usePreviousBuildAsReference: true
]) // ])
} // }
} // }
stage('Test environment') { stage('Test environment') {
steps { steps {
sh '''source /home/cis/Desktop/ENV/pybitenv/bin/activate sh '''
source /home/cis/Desktop/ENV/pybitenv/bin/activate
sh '''cd /home/cis/Desktop/Python/PyBitmessage''' sh '''cd /home/cis/Desktop/Python/PyBitmessage'''
sh '''sudo python setup.py install''' sh '''sudo python setup.py install'''
sh '''sudo /home/cis/.local/bin/nosetests --with-xunit tests''' sh '''sudo /home/cis/.local/bin/nosetests --with-xunit tests'''
} }
} }
stage('Test Run') { stage('Test Run') {
steps { steps {
sh '''python /home/cis/Desktop/Python/PyBitmessage/src/bitmessagemain.py -t''' sh '''python /home/cis/Desktop/Python/PyBitmessage/src/bitmessagemain.py -t'''
} }
} }
} }
post { post {
failure { failure {
mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build error " + mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build error " +