Skip to content

Commit

Permalink
Add "flags" param to codecov (#26)
Browse files Browse the repository at this point in the history
Add a flags param which will be passed to the codecov bash
script command line. This enables specifying the report files,
for example.
  • Loading branch information
axw authored Jan 9, 2019
1 parent 83c4de8 commit 3e852e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions vars/codecov.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ https://github.com/docker/jenkins-pipeline-scripts/blob/master/vars/codecov.groo
def call(Map params = [:]){
def repo = params?.repo
def basedir = params.containsKey('basedir') ? params.basedir : "."
def flags = params.containsKey("flags") ? params.flags : ""

if(!repo){
log(level: 'WARN', text: "Codecov: No repository specified.")
Expand Down Expand Up @@ -32,11 +33,11 @@ def call(Map params = [:]){
"ghprbPullId=${env.CHANGE_ID}",
"GIT_BRANCH=${branchName}",
"CODECOV_TOKEN=${token}"]) {
sh '''#!/bin/bash
sh """#!/bin/bash
set -x
curl -s -o codecov.sh https://codecov.io/bash
bash codecov.sh || echo "codecov exited with $?"
'''
bash codecov.sh ${flags} || echo "codecov exited with \$?"
"""
}
}
}
Expand Down
1 change: 1 addition & 0 deletions vars/codecov.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ codecov(basedir: "${WORKSPACE}", repo: 'apm-agent-go')
```
*repo*: The repository name (for example apm-agent-go), it is needed
*basedir*: the folder to search into (the default value is '.').
*flags*: a string holding arbitrary flags to pass to the codecov bash script

It requires to initialise the pipeline with github_enterprise_constructor() first.

Expand Down

0 comments on commit 3e852e1

Please sign in to comment.