1
0
Fork 0

fix(build): add github status script, remove coverage jobs

This commit is contained in:
ssube 2019-06-15 23:10:24 -05:00
parent cec3576506
commit 5498236052
2 changed files with 11 additions and 47 deletions

View File

@ -122,36 +122,6 @@ publish-npm:
- npm publish
# commit status
climate-pending:
<<: [*build-climate]
stage: status-pre
script:
- cc-test-reporter before-build
climate-failure:
<<: [*build-climate]
stage: status-post
when: on_failure
script:
- cc-test-reporter after-build --debug --exit-code 1
climate-success:
<<: [*build-climate]
stage: status-post
dependencies:
- build-node
script:
- make upload-climate
codecov-success:
<<: [*build-codecov]
stage: status-post
when: on_success
dependencies:
- build-node
script:
- make upload-codecov
github-pending:
<<: [*build-curl]
stage: status-pre
@ -171,20 +141,3 @@ github-success:
when: on_success
script:
- ./scripts/github-status.sh success
sonar-success:
<<: [*build-sonar]
stage: status-post
when: on_success
dependencies:
- build-node
script:
- make node_modules
- sonar-scanner
-Dsonar.projectKey=ssube_isolex
-Dsonar.projectVersion=${CI_COMMIT_REF_SLUG}
-Dsonar.organization=ssube-github
-Dsonar.sources=src/,test/
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.login=${SONAR_SECRET}
-Dsonar.typescript.lcov.reportPaths=out/coverage/lcov.info

11
scripts/github-status.sh Executable file
View File

@ -0,0 +1,11 @@
#! /bin/sh
STATUS="${1}"
CI_COMMIT_SHA="${CI_COMMIT_SHA:-$(git rev-parse HEAD)}"
STATUS_BODY="{\"state\": \"${STATUS}\", \"target_url\": \"${CI_PIPELINE_URL}\", \"description\": \"CI pipeline ${STATUS}!\", \"context\": \"gitlab/build\"}"
printf "Reporting status for %s...\n%s" "${CI_COMMIT_SHA}" "${STATUS_BODY}"
printf "%s" "${STATUS_BODY}" | curl -d @- \
-H "Authorization: token $(printf "%s" "${GITHUB_SECRET}" | base64 -d)" \
-i "https://api.github.com/repos/ssube/salty-dog/statuses/${CI_COMMIT_SHA}"