Skip to content

Instantly share code, notes, and snippets.

@aafaque33
Last active May 29, 2020 16:07
Show Gist options
  • Select an option

  • Save aafaque33/76df63338154e350af92cfe6793c5978 to your computer and use it in GitHub Desktop.

Select an option

Save aafaque33/76df63338154e350af92cfe6793c5978 to your computer and use it in GitHub Desktop.
stages:
- build
build_badges:
stage: build
tags:
- docker-build
before_script:
- chmod +x get-updated-badge-info.sh
script:
- echo "Some script to build your code"
after_script:
- ./get-updated-badge-info.sh
artifacts:
paths:
- badges.json
when: always
expire_in: 4 weeks
#!/bin/bash
echo "collecting stas for badges"
commits=`git rev-list --all --count`
latest_release_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "{\"commits\":\"$commits\", \"release_tag"\:\"$latest_release_tag\"}" > badges.json
@flxholle
Copy link

I have made a sample repository here: https://gitlab.com/asdoi/gitlab_badges_sample

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment