PyBitmessage-2021-04-27/Jenkinsfile

117 lines
3.7 KiB
Plaintext
Raw Normal View History

2019-07-03 13:45:01 +00:00
pipeline {
2019-07-03 13:52:03 +00:00
agent any
2019-07-05 13:44:24 +00:00
triggers {
pollSCM('*/5 * * * *')
2019-07-03 13:45:01 +00:00
}
2019-07-05 14:35:31 +00:00
options {
buildDiscarder(
// Only keep the 10 most recent builds
logRotator(numToKeepStr:'10'))
}
environment {
projectName = 'BitMessage'
emailTo = 'kuldeep.m@cisinlabs.com'
emailFrom = 'kuldeep.m@cisinlabs.com'
VIRTUAL_ENV = "${env.WORKSPACE}/venv"
}
2019-07-05 13:44:24 +00:00
2019-07-03 13:45:01 +00:00
stages {
2019-07-04 14:10:30 +00:00
stage ('Install_Requirements') {
steps {
sh """
2019-07-05 10:32:05 +00:00
echo ${SHELL}
2019-07-04 14:10:30 +00:00
[ -d venv ] && rm -rf venv
#virtualenv --python=python2.7 venv
virtualenv venv
#. venv/bin/activate
export PATH=${VIRTUAL_ENV}/bin:${PATH}
2019-07-04 15:53:25 +00:00
pip install --upgrade pip
2019-07-04 14:10:30 +00:00
pip install -r requirements.txt -r dev-requirements.txt
2019-07-05 08:04:45 +00:00
make clean
2019-07-04 14:10:30 +00:00
"""
}
}
2019-07-05 13:56:52 +00:00
// stage ('Check_style') {
// steps {
// sh """
// if [ ! -d venv ] ; then
2019-07-04 14:10:30 +00:00
2019-07-05 13:56:52 +00:00
// virtualenv --python=python2.7 venv
// fi
// source venv/bin/activate
// export PYTHONPATH="$PWD:$PYTHONPATH"
2019-07-04 14:10:30 +00:00
2019-07-05 13:56:52 +00:00
// pip install pylint
2019-07-04 14:10:30 +00:00
2019-07-05 13:56:52 +00:00
// cd repo
// ### Need this because some strange control sequences when using default TERM=xterm
// export TERM="linux"
2019-07-04 14:10:30 +00:00
2019-07-05 13:56:52 +00:00
// ## || 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
// ])
// }
// }
2019-07-04 14:10:30 +00:00
2019-07-05 13:44:24 +00:00
stage('Test environment') {
steps {
2019-07-05 13:56:52 +00:00
sh '''
2019-07-05 14:05:55 +00:00
echo ${SHELL}
[ -d venv ] && rm -rf venv
#virtualenv --python=python2.7 venv
virtualenv venv
#. venv/bin/activate
export PATH=${VIRTUAL_ENV}/bin:${PATH}
2019-07-05 14:45:26 +00:00
sudo python setup.py install
sudo /home/cis/.local/bin/nosetests --with-xunit tests
2019-07-05 14:05:55 +00:00
'''
2019-07-04 14:10:30 +00:00
}
}
2019-07-05 13:56:52 +00:00
2019-07-05 13:44:24 +00:00
stage('Test Run') {
2019-07-04 14:10:30 +00:00
steps {
2019-07-05 13:44:24 +00:00
sh '''python /home/cis/Desktop/Python/PyBitmessage/src/bitmessagemain.py -t'''
2019-07-03 13:45:01 +00:00
}
}
}
2019-07-05 13:56:52 +00:00
2019-07-05 14:50:35 +00:00
// 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
// }
// }
2019-07-05 13:44:24 +00:00
}