-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release-1.8.0' into aldeed-npm-simple-schema
- Loading branch information
Showing
403 changed files
with
20,212 additions
and
4,299 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
# outputs each tag we're attaching to this docker image | ||
set -e | ||
|
||
SHA=$1 | ||
BRANCH=$2 | ||
SHA1=$(git rev-parse --verify "${SHA}") | ||
|
||
# Echo to stderr | ||
echoerr() { echo "$@" 1>&2; } | ||
|
||
# Ensure that git SHA was provided | ||
if [[ -x "${SHA1}" ]]; then | ||
echoerr "Error, no git SHA provided" | ||
exit 1; | ||
fi | ||
|
||
# tag with the branch | ||
if [[ -n "${BRANCH}" ]]; then | ||
echo "${BRANCH}" | ||
fi | ||
|
||
# Tag with each git tag | ||
git show-ref --tags -d | grep "^${SHA1}" | sed -e 's,.* refs/tags/,,' -e 's/\^{}//' 2> /dev/null \ | ||
| xargs -I % \ | ||
echo "%" | ||
|
||
# Tag with latest if certain conditions are met | ||
if [[ "$BRANCH" == "master" ]]; then | ||
# Check to see if we have a valid `vX.X.X` tag and assign to CURRENT_TAG | ||
CURRENT_TAG=$( \ | ||
git show-ref --tags -d \ | ||
| grep "^${SHA1}" \ | ||
| sed -e 's,.* refs/tags/,,' -e 's/\^{}//' \ | ||
| grep "^v[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+$" \ | ||
| sort \ | ||
) | ||
|
||
# Find the highest tagged version number | ||
HIGHEST_TAG=$(git --no-pager tag | grep "^v[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+$" | sort -r | head -n 1) | ||
|
||
# We tag :latest only if | ||
# 1. We have a current tag | ||
# 2. The current tag is equal to the highest tag, OR the highest tag does not exist | ||
if [[ -n "${CURRENT_TAG}" ]]; then | ||
if [[ "${CURRENT_TAG}" == "${HIGHEST_TAG}" ]] || [[ -z "${HIGHEST_TAG}" ]]; then | ||
echo "latest" | ||
fi | ||
fi | ||
fi |
Oops, something went wrong.