Closed kyfujisa closed 4 years ago
I think this issue has something to do with the failure of the pipeline. https://github.com/docker/cli/issues/2533
I think this issue has something to do with the failure of the pipeline.
@kyfujisa please update the docker version in pipeline. referenece: https://github.com/yahoojapan/garm/pull/39/commits/79472244b64c251ac24111c104d2330b785c372f
Merging #61 into master will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## master #61 +/- ##
=======================================
Coverage 87.02% 87.02%
=======================================
Files 14 14
Lines 655 655
=======================================
Hits 570 570
Misses 75 75
Partials 10 10
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 4dfc749...1a683e2. Read the comment docs.
try to simply the logic as below
case.sh
#!/bin/sh
# LAST_COMMIT="$(git log -1 --pretty=%B)"
LAST_COMMIT="$1"
# if [ ! -z $CIRCLE_PULL_REQUEST ]; then
# PR_NUM="${CIRCLE_PULL_REQUEST##*/}"
# LAST_COMMIT=`curl -s ${GITHUB_API}repos/${REPO_NAME}/${IMAGE_NAME}/pulls/${PR_NUM} | jq .title`
# fi
touch ./.tag
# VERSION="$(git describe --abbrev=0 --tags)"
VERSION="$2"
# if [ -n "$(git diff $VERSION)" ]; then
if [ -n "$3" ]; then
VERSION=${VERSION:-'v0.0.0'}
MAJOR="${VERSION%%.*}"; MAJOR="${MAJOR#v}"; VERSION="${VERSION#*.}"
MINOR="${VERSION%%.*}"; VERSION="${VERSION#*.}"
PATCH="${VERSION%%.*}"; VERSION="${VERSION#*.}"
case "$LAST_COMMIT" in
'[patch]'*)
PATCH=$((PATCH+1))
echo "v$MAJOR.$MINOR.$PATCH" > ./.tag
;;
'[minor]'*)
MINOR=$((MINOR+1))
echo "v$MAJOR.$MINOR.0" > ./.tag
;;
'[major]'*)
MAJOR=$((MAJOR+1))
echo "v$MAJOR.0.0" > ./.tag
;;
'[skip]'*)
echo "Skip release..."
;;
'[skip ci]'* | '[ci skip]'*)
echo "Will skip CI..."
;;
*)
echo "Required prefixes: [major]/[minor]/[patch]/[skip]/[skip ci]"
exit 1
esac
else
echo "NO diff, skip tagging..."
fi
cat ./.tag
rm ./.tag
exit 0
output
$ sh case.sh '[patch] commit' v1.1.1 diff
v1.1.2
$ sh case.sh '[minor] commit' v1.1.1 diff
v1.2.0
$ sh case.sh '[major] commit' v1.1.1 diff
v2.0.0
$ sh case.sh '[skip] commit' v1.1.1 diff
Skip release...
$ sh case.sh '[skip ci] commit' v1.1.1 diff
Will skip CI...
$ sh case.sh '[-] commit' v1.1.1 diff
Required prefixes: [major]/[minor]/[patch]/[skip]/[skip ci]
$ echo $?
1
$ sh case.sh '[patch] commit' v1.1.1 ""
NO diff, skip tagging...
$ sh case.sh '[patch] commit' '' 'diff'
v0.0.1
$ sh case.sh '[minor] commit' '' 'diff'
v0.1.0
$ sh case.sh '[major] commit' '' 'diff'
v1.0.0
$ sh case.sh '[major] commit' 'v2.0.2' 'diff'
v3.0.0
$ sh case.sh '[minor] commit' 'v2.0.2' 'diff'
v2.1.0
$ sh case.sh '[patch] commit' 'v2.0.2' 'diff'
v2.0.3
As a fix to keep pipelines consistent, the first step.
confirmation
test.sh
check