This commit is contained in:
parent
aacbc5025f
commit
7e281b403e
16
.drone.yml
16
.drone.yml
@ -11,14 +11,14 @@ steps:
|
|||||||
- chmod +x ./build.sh
|
- chmod +x ./build.sh
|
||||||
- ./build.sh
|
- ./build.sh
|
||||||
|
|
||||||
- name: docker
|
#- name: docker
|
||||||
image: plugins/docker
|
# image: plugins/docker
|
||||||
settings:
|
# settings:
|
||||||
repo: fbrinker/tileboard
|
# repo: fbrinker/tileboard
|
||||||
username:
|
# username:
|
||||||
from_secret: docker_username
|
# from_secret: docker_username
|
||||||
password:
|
# password:
|
||||||
from_secret: docker_password
|
# from_secret: docker_password
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
|
29
build.sh
Normal file → Executable file
29
build.sh
Normal file → Executable file
@ -10,20 +10,37 @@ 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
|
||||||
|
|
||||||
|
exit 1;
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
Fai riferimento in un nuovo problema
Block a user