Add more boilerplate (#10)
This commit is contained in:
2
.github/workflows/builder.yaml
vendored
2
.github/workflows/builder.yaml
vendored
@@ -81,7 +81,7 @@ jobs:
|
||||
run: |
|
||||
if [[ "${{ steps.info.outputs.architectures }}" =~ ${{ matrix.arch }} ]]; then
|
||||
echo "::set-output name=build_arch::true";
|
||||
echo "::set-output name=image::$(echo '${{ steps.info.outputs.image }}' | cut -d'/' -f3)";
|
||||
echo "::set-output name=image::$(echo ${{ steps.info.outputs.image }} | cut -d'/' -f3)";
|
||||
if [[ -z "${{ github.head_ref }}" ]] && [[ "${{ github.event_name }}" == "push" ]]; then
|
||||
echo "BUILD_ARGS=" >> $GITHUB_ENV;
|
||||
fi
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<!-- https://developers.home-assistant.io/docs/add-ons/presentation#keeping-a-changelog -->
|
||||
|
||||
## 1.1.0
|
||||
|
||||
- Add configuration options
|
||||
- Add labels to the docker image
|
||||
- Install tempio in the docker image to show how args can be used
|
||||
|
||||
## 1.0.1
|
||||
|
||||
- Use yaml for config and build files
|
||||
@@ -9,4 +16,4 @@
|
||||
|
||||
## 0.1.0
|
||||
|
||||
- Initial release
|
||||
- Initial release
|
||||
|
||||
@@ -2,5 +2,11 @@
|
||||
ARG BUILD_FROM
|
||||
FROM $BUILD_FROM
|
||||
|
||||
# Execute during the build of the image
|
||||
ARG TEMPIO_VERSION BUILD_ARCH
|
||||
RUN \
|
||||
curl -sSLf -o /usr/bin/tempio \
|
||||
"https://github.com/home-assistant/tempio/releases/download/${TEMPIO_VERSION}/tempio_${BUILD_ARCH}"
|
||||
|
||||
# Copy data
|
||||
COPY rootfs /
|
||||
COPY rootfs /
|
||||
|
||||
@@ -5,3 +5,10 @@ build_from:
|
||||
armhf: "ghcr.io/home-assistant/armhf-base:3.14"
|
||||
armv7: "ghcr.io/home-assistant/armv7-base:3.14"
|
||||
i386: "ghcr.io/home-assistant/i386-base:3.14"
|
||||
labels:
|
||||
org.opencontainers.image.title: "Home Assistant Add-on: Example add-on"
|
||||
org.opencontainers.image.description: "Example add-on to use as a blueprint for new add-ons."
|
||||
org.opencontainers.image.source: "https://github.com/home-assistant/addons-example"
|
||||
org.opencontainers.image.licenses: "Apache License 2.0"
|
||||
args:
|
||||
TEMPIO_VERSION: "2021.05.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# https://developers.home-assistant.io/docs/add-ons/configuration#add-on-config
|
||||
name: Example add-on
|
||||
version: "1.0.1"
|
||||
version: "1.1.0"
|
||||
slug: example
|
||||
description: Example add-on
|
||||
url: "https://github.com/home-assistant/addons-example/tree/master/example"
|
||||
@@ -11,4 +11,8 @@ arch:
|
||||
- amd64
|
||||
- i386
|
||||
startup: once
|
||||
options:
|
||||
message: "Hello world..."
|
||||
schema:
|
||||
message: "str?"
|
||||
image: "ghcr.io/home-assistant/{arch}-addon-example"
|
||||
|
||||
@@ -3,8 +3,16 @@
|
||||
# Start the example service
|
||||
# ==============================================================================
|
||||
|
||||
## Add your code here
|
||||
# Add your code here
|
||||
|
||||
bashio::log.info "Hello world"
|
||||
## Get the 'message' key from the user config options.
|
||||
CONFIG_MESSAGE=$(bashio::config 'message')
|
||||
|
||||
## Set the message to be printed, defaults to "Hello World..."
|
||||
PRINT_MESSAGE=${CONFIG_MESSAGE:="Hello World..."}
|
||||
|
||||
## Print the message the user supplied
|
||||
bashio::log.info "${PRINT_MESSAGE}"
|
||||
|
||||
## Run your program
|
||||
# exec my_program --with-params
|
||||
|
||||
4
example/translations/en.yaml
Normal file
4
example/translations/en.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
configuration:
|
||||
message:
|
||||
name: Message
|
||||
description: The message that will be printed to the log when starting this example add-on.
|
||||
Reference in New Issue
Block a user