fix(status-badge): set git branch

This commit is contained in:
curben 2020-04-01 10:14:30 +01:00
parent a7f38938ff
commit 4d5f8fb87d
No known key found for this signature in database
GPG Key ID: 5D9DB57A25D34EE3
1 changed files with 8 additions and 4 deletions

View File

@ -29,11 +29,13 @@ deploy_job:
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- git checkout master
- git config --global user.name "curben-bot"
- git config --global user.email "3048979-curben-bot@users.noreply.gitlab.com"
# Generate successful status badge
- mkdir -p .gitlab/
- wget https://img.shields.io/badge/pipeline-passed-success.svg -O .gitlab/status.svg
- git config --global user.name "curben-bot"
- git config --global user.email "3048979-curben-bot@users.noreply.gitlab.com"
- git add .gitlab/status.svg
# Only commit when diff exists https://stackoverflow.com/a/8123841
- git diff-index --quiet HEAD || git commit -m "Success pipeline"
@ -69,10 +71,12 @@ failed_job:
- chmod 644 ~/.ssh/known_hosts
script:
- mkdir -p .gitlab/
- wget https://img.shields.io/badge/pipeline-failed-critical.svg -O .gitlab/status.svg
- git checkout master
- git config --global user.name "curben-bot"
- git config --global user.email "3048979-curben-bot@users.noreply.gitlab.com"
- mkdir -p .gitlab/
- wget https://img.shields.io/badge/pipeline-failed-critical.svg -O .gitlab/status.svg
- git add .gitlab/status.svg
- git diff-index --quiet HEAD || git commit -m "Failed pipeline"
- ssh -T git@gitlab.com