Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "flags" param to codecov #26

Merged
merged 1 commit into from
Jan 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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