Skip to content

Commit 6b13756

Browse files
fix(CI): explicitly set codecov git SHA (#221)
1 parent cbc085f commit 6b13756

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ RUN echo "deb http://packages.cloud.google.com/apt cloud-sdk-jessie main" \
1212

1313
ENV CGO_ENABLED=0
1414

15+
ADD https://codecov.io/bash /usr/local/bin/codecov
16+
RUN chmod +x /usr/local/bin/codecov
17+
1518
COPY glide.yaml /go/src/github.com/deis/workflow-cli/
1619
COPY glide.lock /go/src/github.com/deis/workflow-cli/
1720

Jenkinsfile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,16 @@ parallel(
110110
withCredentials([[$class: 'StringBinding',
111111
credentialsId: '995d99a7-466b-4beb-bf75-f3ba91cbbc18',
112112
variable: 'CODECOV_TOKEN']]) {
113-
sh "docker run -e CODECOV_TOKEN=\${CODECOV_TOKEN} --rm ${test_image} sh -c 'test-cover.sh && curl -s https://codecov.io/bash | bash'"
113+
def codecov = "codecov -Z -C ${git_commit} "
114+
if (git_branch == "remotes/origin/master") {
115+
codecov += "-B master"
116+
} else {
117+
def branch_name = env.BRANCH_NAME
118+
def branch_index = branch_name.indexOf('-')
119+
def pr = branch_name.substring(branch_index+1, branch_name.length())
120+
codecov += "-P ${pr}"
121+
}
122+
sh "docker run -e CODECOV_TOKEN=\${CODECOV_TOKEN} --rm ${test_image} sh -c 'test-cover.sh && ${codecov}'"
114123
}
115124
}
116125
}
@@ -182,7 +191,7 @@ parallel(
182191
if (git_branch == "remotes/origin/master") {
183192
def tmp_dir = mktmp()
184193
def dist_dir = "-e DIST_DIR=/upload -v ${tmp_dir}:/upload"
185-
sh "docker run ${dist_dir} --rm ${test_image} ${version_flags} make build-latest"
194+
sh "docker run ${dist_dir} ${version_flags} --rm ${test_image} make build-latest"
186195

187196
upload_artifacts(dist_dir, '6029cf4e-eaa3-4a8e-9dc7-744d118ebe6a', master_gcs_bucket, false)
188197
sh "docker run ${dist_dir} --rm ${test_image} sh -c 'rm -rf /upload/*'"

0 commit comments

Comments
 (0)