changes in file13

This commit is contained in:
shikhar.s 2019-07-05 21:03:39 +05:30
parent 95b6ef42f1
commit c5872c4ea1

44
Jenkinsfile vendored
View File

@ -1,11 +1,5 @@
pipeline { pipeline {
agent any agent any
triggers {
pollSCM('*/5 * * * *')
}
options { options {
buildDiscarder( buildDiscarder(
// Only keep the 10 most recent builds // Only keep the 10 most recent builds
@ -17,10 +11,16 @@ pipeline {
emailFrom = 'kuldeep.m@cisinlabs.com' emailFrom = 'kuldeep.m@cisinlabs.com'
VIRTUAL_ENV = "${env.WORKSPACE}/venv" VIRTUAL_ENV = "${env.WORKSPACE}/venv"
} }
stages { stages {
/*
stage ('Checkout') {
steps {
checkout scm
}
}
*/
stage ('Install_Requirements') { stage ('Install_Requirements') {
steps { steps {
@ -38,6 +38,7 @@ pipeline {
} }
} }
// stage ('Check_style') { // stage ('Check_style') {
// steps { // steps {
// sh """ // sh """
@ -72,16 +73,14 @@ pipeline {
stage('Test environment') { stage('Test environment') {
steps { steps {
sh ''' sh '''
echo ${SHELL} echo ${SHELL}
[ -d venv ] && rm -rf venv [ -d venv ] && rm -rf venv
#virtualenv --python=python2.7 venv #virtualenv --python=python2.7 venv
virtualenv venv virtualenv venv
#. venv/bin/activate #. venv/bin/activate
export PATH=${VIRTUAL_ENV}/bin:${PATH} export PATH=${VIRTUAL_ENV}/bin:${PATH}
sudo python setup.py install python setup.py install
sudo /home/cis/.local/bin/nosetests --with-xunit tests sudo /home/cis/.local/bin/nosetests --with-xunit tests
''' '''
} }
} }
@ -89,7 +88,13 @@ pipeline {
stage('Test Run') { stage('Test Run') {
steps { steps {
sh '''python /home/cis/Desktop/Python/PyBitmessage/src/bitmessagemain.py -t''' sh '''python src/bitmessagemain.py -t'''
}
}
stage ('Cleanup') {
steps {
sh 'rm -rf venv'
} }
} }
} }
@ -97,7 +102,22 @@ pipeline {
post { post {
failure { failure {
echo "Send e-mail, when failed" 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
} }
} }
} }