比较提交

...

5 次代码提交

作者 SHA1 备注 提交日期
Florian Brinker
e7317fa30f Add version check 2021-04-21 23:48:42 +02:00
Florian Brinker
ca32883cac Add version check
所有检测均成功
continuous-integration/drone Build is passing
2021-04-21 23:47:57 +02:00
Florian Brinker
9cd25b3a49 Test version check
所有检测均成功
continuous-integration/drone Build is passing
2021-04-21 23:44:40 +02:00
Florian Brinker
2784367a2d Test version check
所有检测均成功
continuous-integration/drone Build is passing
2021-04-21 23:41:40 +02:00
Florian Brinker
7e281b403e Test version check
一些检查失败了
continuous-integration/drone Build is failing
2021-04-21 23:39:23 +02:00
共有 2 个文件被更改,包括 24 次插入9 次删除

查看文件

@ -7,7 +7,7 @@ steps:
- name: build - name: build
image: alpine image: alpine
commands: commands:
- apk update && apk add bash grep sed curl unzip - apk update && apk add bash grep sed curl unzip jq
- chmod +x ./build.sh - chmod +x ./build.sh
- ./build.sh - ./build.sh

27
build.sh 普通文件 -> 可执行文件
查看文件

@ -10,20 +10,35 @@ getVersionFromLatestRelease() {
} }
downloadLatestRelease() { downloadLatestRelease() {
URL=`curl -s "https://api.github.com/repos/resoai/TileBoard/releases/latest" \ url=`curl -s "https://api.github.com/repos/resoai/TileBoard/releases/latest" \
| grep "browser_download_url" \ | grep "browser_download_url" \
| cut -d '"' -f 4` | cut -d '"' -f 4`
echo "Url: $URL" echo "Url: $url"
curl -sL -o $1 ${URL} curl -sL -o $1 ${url}
} }
LATEST=`getVersionFromLatestRelease` getLatestPublishedTag() {
SEMVER=( ${LATEST//./ } ) latest_tag=`curl -s "https://hub.docker.com/v2/repositories/fbrinker/tileboard/tags?page_size=1" \
| jq -r ".results[0].name"`
echo "$latest_tag"
}
LATEST_RELEASE=`getVersionFromLatestRelease`
LATEST_TAG=`getLatestPublishedTag`
if [ "$LATEST_RELEASE" = "$LATEST_TAG" ]; then
echo "Nothing to do. Versions already match."
echo "Release: $LATEST_RELEASE"
echo "Tag: $LATEST_TAG"
exit 78 # drone.io exit code to stop but success the pipeline
fi
SEMVER=( ${LATEST_RELEASE//./ } )
MAJOR=${SEMVER[0]} MAJOR=${SEMVER[0]}
MINOR=${SEMVER[0]}.${SEMVER[1]} MINOR=${SEMVER[0]}.${SEMVER[1]}
PATCH=$LATEST PATCH=$LATEST_RELEASE
echo "latest,$MAJOR,$MINOR,$PATCH" > .tags echo "latest,$MAJOR,$MINOR,$PATCH" > .tags