diff --git a/.gitlab/gen-badge.sh b/.gitlab/gen-badge.sh index d5dd61b784823e148de71ad6eaae5db72bf64659..0c419dc4b35fa1497f0e82da7f2fb93a4d58de75 100644 --- a/.gitlab/gen-badge.sh +++ b/.gitlab/gen-badge.sh @@ -1,12 +1,11 @@ #!/bin/bash GITLAB_URL="https://gitlab.phaidra.org" -PIPELINE_STATUS=$(curl -fsSL -H "PRIVATE-TOKEN: ${CI_TOKEN}" "${GITLAB_URL}/api/v4/projects/450/pipelines/latest?ref=${CI_COMMIT_BRANCH}" | jq --raw-output .detailed_status.text) -echo "[INFO] pipeline status: ${PIPELINE_STATUS}" -anybadge --label pipeline --value "${PIPELINE_STATUS}" failed=red passed=green canceled=darkgray > "./final/${APP_VERSION}/images/pipeline.svg" +# if we reached this script, all the tests have passed +anybadge --label pipeline --value "passed" failed=red passed=green canceled=darkgray > "./final/${APP_VERSION}/images/pipeline.svg" PIPELINE_COVERAGE=$(curl -fsSL -H "PRIVATE-TOKEN: ${CI_TOKEN}" "${GITLAB_URL}/api/v4/projects/450/pipelines/latest?ref=${CI_COMMIT_BRANCH}" | jq --raw-output .coverage) echo "[INFO] pipeline coverage: ${PIPELINE_COVERAGE}" if [ "${PIPELINE_COVERAGE}" != "null" ]; then - anybadge --label pipeline --value "${PIPELINE_COVERAGE}" unknown=darkgray 70=red 80=orange 90=yellow 95=green > "./final/${APP_VERSION}/images/coverage.svg" + anybadge --label pipeline --value "${PIPELINE_COVERAGE}" 70=red 80=orange 90=yellow 95=green > "./final/${APP_VERSION}/images/coverage.svg" else echo "[WARNING] Skipping badge generation, displaying default badge text: unknown" fi