zalando-stups / documentation

Documentation for the STUPS ecosystem
https://docs.stups.io/
18 stars 54 forks source link

Inconsistency between scm-source doc and example #121

Open Unisay opened 7 years ago

Unisay commented 7 years ago

The document describes revision field in the scm-source.json as follows:

The SCM revision, e.g. the full git commit sha1. The revision should end with the marker text ” (locally modified)” for unclean working directories. This marker text ensures that no exact match for such revisions can be found in the remote SCM repository.

but the example implementation in bash adds suffix (locally midified) to the status field, not revision:

#!/bin/bash
REV=$(git rev-parse HEAD)
URL=$(git config --get remote.origin.url)
STATUS=$(git status --porcelain)
if [ -n "$STATUS" ]; then
    REV="$REV (locally modified)"
fi
# finally write hand-crafted JSON to scm-source.json
echo '{"url": "git:'$URL'", "revision": "'$REV'", "author": "'$USER'", "status": "'$STATUS'"}' > scm-source.json