In this post I’m going to explain the steps in order to integrate pycabehtml https://bitbucket.org/jordilin/pycabehtml into Jenkins using the Html Plugin.
- Add build step Execute Shell.
- You’ll see a text box where you will be able to write the shell script that will be executed in order to build your project and obtain metrics.
Write the following in the text box.
cd $WORKSPACE COMPLEXITY_DIR=$WORKSPACE/complexity GRAPH=$COMPLEXITY_DIR/output.png ACC=/usr/local/jenkins/jenkinsprojectname/complexity_acc.txt mkdir -p $COMPLEXITY_DIR pymetrics `find yoursrc/ -iname "*.py"` > $COMPLEXITY_DIR/complexity.txt pycabehtml.py -i $COMPLEXITY_DIR/complexty.txt -o $COMPLEXITY_DIR/metrics.html -a $ACC -g $GRAPH
4. You can save this script into a shell script and put it under source control (recommended), and then execute this shell script from the jenkins build step execute shell.
5. Enable the Html plugin for Jenkins



