PyBitmessage-2021-04-27/Jenkinsfile
2019-07-05 19:26:52 +05:30

98 lines
3.2 KiB
Groovy

pipeline {
agent any
triggers {
pollSCM('*/5 * * * *')
}
stages {
stage ('Install_Requirements') {
steps {
sh """
echo ${SHELL}
[ -d venv ] && rm -rf venv
#virtualenv --python=python2.7 venv
virtualenv venv
#. venv/bin/activate
export PATH=${VIRTUAL_ENV}/bin:${PATH}
pip install --upgrade pip
pip install -r requirements.txt -r dev-requirements.txt
make clean
"""
}
}
// stage ('Check_style') {
// steps {
// sh """
// if [ ! -d venv ] ; then
// virtualenv --python=python2.7 venv
// fi
// source venv/bin/activate
// export PYTHONPATH="$PWD:$PYTHONPATH"
// pip install pylint
// cd repo
// ### Need this because some strange control sequences when using default TERM=xterm
// export TERM="linux"
// ## || 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
// """
// step([$class: 'WarningsPublisher',
// parserConfigurations: [
// [
// parserName: 'pylint',
// pattern: 'report/pylint.log'
// ]],
// unstableTotalAll: '0',
// usePreviousBuildAsReference: true
// ])
// }
// }
stage('Test environment') {
steps {
sh '''
source /home/cis/Desktop/ENV/pybitenv/bin/activate
sh '''cd /home/cis/Desktop/Python/PyBitmessage'''
sh '''sudo python setup.py install'''
sh '''sudo /home/cis/.local/bin/nosetests --with-xunit tests'''
}
}
stage('Test Run') {
steps {
sh '''python /home/cis/Desktop/Python/PyBitmessage/src/bitmessagemain.py -t'''
}
}
}
post {
failure {
mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build error " +
"is here: ${env.BUILD_URL}\nStarted by ${env.BUILD_CAUSE}" ,
from: env.emailFrom,
//replyTo: env.emailFrom,
subject: "${env.projectName} ${env.JOB_NAME} (${env.BUILD_NUMBER}) build failed",
to: env.emailTo
}
success {
mail body: "${env.JOB_NAME} (${env.BUILD_NUMBER}) ${env.projectName} build successful\n" +
"Started by ${env.BUILD_CAUSE}",
from: env.emailFrom,
//replyTo: env.emailFrom,
subject: "${env.projectName} ${env.JOB_NAME} (${env.BUILD_NUMBER}) build successful",
to: env.emailTo
}
}
}