форк від fbrinker/docker-tileboard-OUTDATED
Порівняти коміти
No commits in common. "413444926092a55bc3a2cecca7aaee50e159cfcb" and "3b342aa68be5748467ee251aaa947e8e85185fe1" have entirely different histories.
4134449260
...
3b342aa68b
42
.drone.yml
42
.drone.yml
@ -1,35 +1,10 @@
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: Production
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: Build Dockerfile
|
||||
image: alpine
|
||||
commands:
|
||||
- apk update && apk add bash curl grep jq sed
|
||||
- ./build.sh
|
||||
|
||||
- name: Build & Publish Image
|
||||
image: plugins/docker
|
||||
settings:
|
||||
repo: fbrinker/tileboard
|
||||
dockerfile: Dockerfile
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: Development
|
||||
|
||||
steps:
|
||||
- name: Check for changes in master branch
|
||||
image: alpine
|
||||
commands:
|
||||
@ -60,6 +35,21 @@ steps:
|
||||
password:
|
||||
from_secret: docker_password
|
||||
|
||||
- name: Prepare Release Dockerfile
|
||||
image: alpine
|
||||
commands:
|
||||
- apk update && apk add bash curl grep jq sed
|
||||
- ./build.sh
|
||||
|
||||
- name: Build & Publish Release Image
|
||||
image: plugins/docker
|
||||
settings:
|
||||
repo: fbrinker/tileboard
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
@ -28,7 +28,7 @@ Besides the latest version, you can listen to updates for a specific version:
|
||||
* fbrinker/tileboard:2.2.0
|
||||
|
||||
Additionally, there are `nightly` and `dev` builds as follows:
|
||||
* `fbrinker/tileboard:nightly` contains a nightly build of TileBoard's `master` branch. Use it to have the most bleeding edge changes, which have not made it into a release yet.
|
||||
* `fbrinker/tileboard:nightly` contains a nightly build of TileBoard's `master` branch. Use it to have the mode bleeding adge changes, which have not yet made it to a release version.
|
||||
* `fbrinker/tileboard:dev` bundles TileBoard's source code and runs `yarn run dev` inside the container. Use it to modify the source, check your changes into GitHub and propose a pull request to TileBoard. See the TileBoard [contribution page](https://github.com/resoai/TileBoard/blob/master/CONTRIBUTING.md) for details.
|
||||
|
||||
|
||||
|
37
build.sh
37
build.sh
@ -1,40 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
getVersionFromLatestRelease() {
|
||||
repo="${1-resoai/TileBoard}"
|
||||
version=`curl -s "https://api.github.com/repos/$repo/releases/latest" \
|
||||
version=`curl -s "https://api.github.com/repos/resoai/TileBoard/releases/latest" \
|
||||
| grep "tag_name" \
|
||||
| cut -d '"' -f 4 \
|
||||
| sed -e "s/v//"`
|
||||
|
||||
|
||||
echo "$version"
|
||||
}
|
||||
|
||||
getDownloadUrl() {
|
||||
repo="${1-resoai/TileBoard}"
|
||||
url=`curl -s "https://api.github.com/repos/$repo/releases/latest" \
|
||||
url=`curl -s "https://api.github.com/repos/resoai/TileBoard/releases/latest" \
|
||||
| grep "browser_download_url" \
|
||||
| cut -d '"' -f 4`
|
||||
|
||||
|
||||
echo "$url"
|
||||
}
|
||||
|
||||
docker_tag_exists() {
|
||||
repo="${1-fbrinker/tileboard}"
|
||||
tag="${2-latest}"
|
||||
curl --silent -f -lSL "https://hub.docker.com/v2/repositories/$repo/tags/$tag" > /dev/null 2>&1
|
||||
getLatestPublishedTag() {
|
||||
latest_tag=`curl -s "https://hub.docker.com/v2/repositories/fbrinker/tileboard/tags?page_size=1" \
|
||||
| jq -r ".results[0].name"`
|
||||
|
||||
echo "$latest_tag"
|
||||
}
|
||||
|
||||
source_repo="${1-resoai/TileBoard}"
|
||||
docker_repo="${2-fbrinker/tileboard}"
|
||||
echo "Source repository: $source_repo."
|
||||
echo "Docker repository: $docker_repo."
|
||||
LATEST_RELEASE=`getVersionFromLatestRelease`
|
||||
LATEST_TAG=`getLatestPublishedTag`
|
||||
|
||||
LATEST_RELEASE=`getVersionFromLatestRelease $source_repo`
|
||||
echo "Latest release is: $LATEST_RELEASE."
|
||||
|
||||
if docker_tag_exists $docker_repo $LATEST_RELEASE; then
|
||||
echo "Nothing to do. Latest release tag already exists."
|
||||
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
|
||||
|
||||
@ -46,7 +42,6 @@ PATCH=$LATEST_RELEASE
|
||||
echo "latest,$MAJOR,$MINOR,$PATCH" > .tags
|
||||
|
||||
RELEASE_URL=`getDownloadUrl`
|
||||
echo "URL of release is: $RELEASE_URL."
|
||||
|
||||
echo "Writing release URL into Dockerfile..."
|
||||
echo "Writing $RELEASE_URL into Dockerfile..."
|
||||
sed -i "s|%RELEASE_URL%|$RELEASE_URL|g" ./Dockerfile
|
||||
|
Посилання в новій задачі
Block a user