Skip to content
Snippets Groups Projects
Verified Commit 01683318 authored by Martin Weise's avatar Martin Weise
Browse files

Fixed badges

parent dd52e3ca
Branches
Tags
No related merge requests found
#!/bin/bash #!/bin/bash
GITLAB_URL="https://gitlab.phaidra.org"
# if we reached this script, all the tests have passed
anybadge --label pipeline --value "passed" failed=red passed=green canceled=darkgray > "./final/${DOC_VERSION}/images/pipeline.svg" anybadge --label pipeline --value "passed" failed=red passed=green canceled=darkgray > "./final/${DOC_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) PIPELINE_COVERAGE=$(curl -fsSL -H "PRIVATE-TOKEN: ${CI_TOKEN}" "${GITLAB_URL}/api/v4/projects/${GITLAB_PROJECT_ID}/pipelines/latest?ref=${CI_COMMIT_BRANCH}" | jq --raw-output .coverage)
echo "[INFO] pipeline coverage: ${PIPELINE_COVERAGE}" echo "[INFO] pipeline coverage: ${PIPELINE_COVERAGE}"
if [ "${PIPELINE_COVERAGE}" != "null" ]; then if [ "${PIPELINE_COVERAGE}" != "null" ]; then
anybadge --label coverage --value "${PIPELINE_COVERAGE}" coverage > "./final/${DOC_VERSION}/images/coverage.svg" anybadge --label coverage --value "${PIPELINE_COVERAGE}" coverage > "./final/${DOC_VERSION}/images/coverage.svg"
else else
echo "[WARNING] Skipping badge generation, displaying default badge text: unknown" echo "[WARNING] Skipping badge generation, displaying default badge text: unknown"
fi fi
curl "${SONARQUBE_URL}/api/project_badges/measure?project=fair-data-austria-db-repository_fda-services_a57fa043-ab99-4cdd-a721-162d9a916d77&metric=sqale_rating&token=${CI_SONAR_TOKEN}" > "./final/${DOC_VERSION}/images/maintainability.svg"
curl "${SONARQUBE_URL}/api/project_badges/measure?project=fair-data-austria-db-repository_fda-services_a57fa043-ab99-4cdd-a721-162d9a916d77&metric=security_rating&token=${CI_SONAR_TOKEN}" > "./final/${DOC_VERSION}/images/security.svg" curl -fsSL "${CI_SONAR_URL}/api/project_badges/measure?project=${CI_SONAR_PROJECT_KEY}&metric=sqale_rating&token=${CI_SONAR_TOKEN}" > "./final/${DOC_VERSION}/images/maintainability.svg"
echo "[INFO] retrieved SonarQube badges" curl -fsSL "${CI_SONAR_URL}/api/project_badges/measure?project=${CI_SONAR_PROJECT_KEY}&metric=security_rating&token=${CI_SONAR_TOKEN}" > "./final/${DOC_VERSION}/images/security.svg"
\ No newline at end of file
echo "[INFO] retrieved badges"
\ No newline at end of file
No preview for this file type
...@@ -4,6 +4,6 @@ dependencies: ...@@ -4,6 +4,6 @@ dependencies:
version: 19.1.2 version: 19.1.2
- name: common - name: common
repository: oci://registry-1.docker.io/bitnamicharts repository: oci://registry-1.docker.io/bitnamicharts
version: 2.27.2 version: 2.28.0
digest: sha256:31ff69e1352ee168304708757800eb5a0af6185f01d4214ced74eeb0bfeb19ef digest: sha256:cb5ef9761fc335713b8908c3e264dfdda602839b400ede4ce6d648348dd9343c
generated: "2024-12-01T21:27:01.359665638+01:00" generated: "2024-12-16T08:33:35.849012355-05:00"
File deleted
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment