Skip to content

Commit

Permalink
fix(build): add github status script, remove coverage jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jun 16, 2019
1 parent cec3576 commit 5498236
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 47 deletions.
47 changes: 0 additions & 47 deletions .gitlab-ci.yml
Expand Up @@ -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
Expand All @@ -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 changes: 11 additions & 0 deletions scripts/github-status.sh
@@ -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}"

0 comments on commit 5498236

Please sign in to comment.