Commit a17ffcb4 authored by Daniel Eggert's avatar Daniel Eggert
Browse files

added xpath|grep|awk coverage parsing command

parent d8ceaa77
......@@ -41,7 +41,11 @@ pages:
stage: deploy
- mvn clean cobertura:cobertura
- grep 'coverage line-rate' usgs-api/target/site/cobertura/coverage.xml
# now extract the actual value from the coverage report and print it to the console
# [1] (xpath) extract the line-rate attribute out of the xml file, uses xpath, so 'libxml-xpath-perl' has to be installed on the runner
# [2] (grep) get rid of the attribute text so only the actual number remains
# [3] (awk) multiply the value (0..1) to get the need percent value
- xpath -q -e '/coverage/@line-rate' workspace/gms-aux/usgs-api/target/site/cobertura/coverage.xml | grep -o '[[:digit:]]\.[[:digit:]]\{1,\}' | awk '{print "Coverage: " $0*100}'
- mv usgs-api/target/site/cobertura/ public/
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment