Created
August 6, 2021 03:30
-
-
Save ronaldmiranda/d6a9fd27bf78db2be3f43fbad168378f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
STABLE_GIT_COMMIT_SUFFIX=$([[ -n "$(git status --porcelain)" ]] && echo '-dirty') | |
echo "STABLE_GIT_COMMIT $(git rev-parse --short HEAD)" | |
echo "STABLE_GIT_COMMIT_SUFFIX $STABLE_GIT_COMMIT_SUFFIX" | |
echo "STABLE_GIT_DATE $(TZ=UTC git show --quiet --date='format-local:%Y-%m-%dT%H:%M:%SZ' --format="%cd")" | |
echo "STABLE_K8S_VERSION $(git log -n 1 --pretty='format:%cd' --date=format:'%Y.%m.%d.%H%M')$STABLE_GIT_COMMIT_SUFFIX" | |
echo "STABLE_DOCKER_TAG $(git log -n 1 --pretty='format:%cd-%h' --date=format:'%Y%m%d%H%M')$STABLE_GIT_COMMIT_SUFFIX" | |
echo "STABLE_VERSION_LABEL $(date '+%y.%m.%d.%H%M')$STABLE_GIT_COMMIT_SUFFIX" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment