Skip to content

Commit

Permalink
Added codecov badge to README (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
fgorostiaga authored Oct 2, 2017
1 parent 9cd061c commit 3c8ec45
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
18 changes: 5 additions & 13 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,11 @@ node('docker') {

stage "Publish code coverage"
echo ("Publishing code coverage")
def codecovArgs = '-K '
if (env.GITHUB_PR_NUMBER != '') {
// This is a PR
codecovArgs += "-B ${env.GITHUB_PR_TARGET_BRANCH} " +
"-C ${env.GITHUB_PR_HEAD_SHA} " +
"-P ${env.GITHUB_PR_NUMBER} "
} else {
// Not a PR
codecovArgs += "-B ${env.GIT_BRANCH} " +
"-C ${env.GIT_COMMIT} "
}
sh "echo args = ${codecovArgs}"
sh 'docker run -v $(pwd)/go_EMS:/go/go_EMS golang /bin/bash -c "cd go_EMS; go test -race -coverprofile=coverage.txt -covermode=atomic; curl -s https://codecov.io/bash | bash -s - ${codecovArgs} -t ${COB_EMS_TOKEN} || echo \'Codecov did not collect coverage reports\'"'
sh "mkdir shared || true"
sh 'export PWD=$(pwd)'
sh 'docker run -v ${PWD}/shared:/shared -v ${PWD}/go_EMS:/go/go_EMS golang /bin/bash -c "cd go_EMS; go test -race -coverprofile=coverage.txt -covermode=atomic; mv coverage.txt /shared"'
sh "curl -s https://codecov.io/bash > shared/curlout.txt"
sh "cd shared; JENKINS_URL= bash <curlout.txt -s - -t ${COB_EMS_TOKEN}; cd ..; rm -rf shared"

stage "Build images - Package"
echo ("Building full version")
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[![License badge](https://img.shields.io/badge/license-Apache2-green.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![Documentation badge](https://img.shields.io/badge/docs-latest-brightgreen.svg)](http://elastest.io/docs/)
[![Build Status](https://ci.elastest.io/jenkins/buildStatus/icon?job=elastest-monitoring-service/ems)](https://ci.elastest.io/jenkins/job/elastest-monitoring-service/ems)
[![codecov](https://codecov.io/gh/elastest/elastest-monitoring-service/branch/master/graph/badge.svg)](https://codecov.io/gh/elastest/elastest-monitoring-service)

[![][ElasTest Logo]][ElasTest]

Expand Down

0 comments on commit 3c8ec45

Please sign in to comment.