From 5498236052176f9437671552419d9be36e91bedf Mon Sep 17 00:00:00 2001 From: ssube Date: Sat, 15 Jun 2019 23:10:24 -0500 Subject: [PATCH] fix(build): add github status script, remove coverage jobs --- .gitlab-ci.yml | 47 ---------------------------------------- scripts/github-status.sh | 11 ++++++++++ 2 files changed, 11 insertions(+), 47 deletions(-) create mode 100755 scripts/github-status.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3f39340..930edab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/scripts/github-status.sh b/scripts/github-status.sh new file mode 100755 index 0000000..e4bf2a4 --- /dev/null +++ b/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}"