diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 213da881fe1e3cf9419aad1db990d091d0202e43..7c824385a8f97bb80faa35503d39de0f3a6b7b83 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,12 +8,27 @@ before_script: - mkdir -p ~/.bdbag stages: + - badges - unit - aggregation - reference - integration - consistency +build_bages: + stage: badges + only: + - master + script: + - echo "Building badges" + after_script: + - ./get-updated-badge-info.sh + artifacts: + paths: + - badges.json + when: always + expire_in: 3 months + getBag: stage: unit only: diff --git a/get-updated-badge-info.sh b/get-updated-badge-info.sh new file mode 100644 index 0000000000000000000000000000000000000000..9dcd5e009db30d03f4992e7852507f9432b9ee7a --- /dev/null +++ b/get-updated-badge-info.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +echo "collecting stats for badges" + +commits=`git rev-list --all --count` +latest_release_tag=$(git describe --tags `git rev-list --tags --max-count=1`) +current_pipeline_version=$(cat ./workflow/nextflow.config | grep -o version.* | grep -oP "(?<=').*(?=')") +current_nextflow_version=$(cat ./workflow/nextflow.config | grep -o nextflowVersion.* | grep -oP "(?<=').*(?=')") +echo "{\"commits\":\"$commits\", \"release_tag\":\"$latest_release_tag\", \"pipeline\":\"$current_pipeline_version\", \"nextflow\":\"$current_nextflow_version\"}" > badges.json \ No newline at end of file