From bb9c334add0b33e80ac31cd7909e61cf35c9a46a Mon Sep 17 00:00:00 2001 From: cis-kuldeep Date: Wed, 3 Jul 2019 19:15:01 +0530 Subject: [PATCH] jenkins file --- Jenkinsfile | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..0591afe0 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,54 @@ +pipeline { + agent admin + + triggers { + pollSCM('*/5 * * * *') + } + options { + skipDefaultCheckout(true) + // Keep the 10 most recent builds + buildDiscarder(logRotator(numToKeepStr: '10')) + timestamps() + } + environment { + PATH="/var/lib/jenkins/miniconda3/bin:$PATH" + } + + stages { + + stage ("Code pull"){ + steps{ + checkout scm + } + } + stage('Build environment') { + steps { + sh '''export WORKSPACE=`pwd` + source /home/cis/Desktop/ENV/pybitenv/bin/activate + pip install -r /home/cis/Desktop/Python/PyBitmessage/requirements.txt + ''' + } + } + stage('Test environment') { + steps { + sh '''export WORKSPACE=`pwd` + source /home/cis/Desktop/ENV/pybitenv/bin/activate + cd /home/cis/Desktop/Python/PyBitmessage + sudo python setup.py install + 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 { + echo "Send e-mail, when failed" + } + } +}