Skip to content

Commit b686519

Browse files
Merge pull request #1 from marciogranzotto/hassio-addon
Hassio addon
2 parents c4f05fa + d874558 commit b686519

19 files changed

Lines changed: 408 additions & 85 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#-------------------------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
4+
#-------------------------------------------------------------------------------------------------------------
5+
6+
# Update the VARIANT arg in devcontainer.json to pick an Ubuntu version: focal (or ubuntu-20.04), bionic (or ubuntu-18.04)
7+
# To fully customize the contents of this image, use the following Dockerfile instead:
8+
# https://github.com/microsoft/vscode-dev-containers/tree/v0.128.0/containers/ubuntu/.devcontainer/base.Dockerfile
9+
ARG VARIANT="focal"
10+
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
11+
12+
# ** [Optional] Uncomment this section to install additional packages. **
13+
#
14+
# RUN apt-get update \
15+
# && export DEBIAN_FRONTEND=noninteractive \
16+
# && apt-get -y install --no-install-recommends <your-package-list-here>
17+
18+
ARG HADOLINT_VERSION=v1.17.6
19+
RUN wget -O /usr/local/bin/hadolint https://github.com/hadolint/hadolint/releases/download/${HADOLINT_VERSION}/hadolint-Linux-x86_64 \
20+
&& chmod +x /usr/local/bin/hadolint

.devcontainer/devcontainer.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.128.0/containers/ubuntu
3+
{
4+
"name": "Ubuntu",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
// Update 'VARIANT' to pick an Ubuntu version. Rebuild the container if it already
8+
// exists to update. Available variants: focal (or ubuntu-20.04), bionic (or ubuntu-18.04)
9+
"args": { "VARIANT": "focal" }
10+
},
11+
12+
// Set *default* container specific settings.json values on container create.
13+
"settings": {
14+
"terminal.integrated.shell.linux": "/bin/bash"
15+
},
16+
17+
// Add the IDs of extensions you want installed when the container is created.
18+
"extensions": [
19+
"exiasr.hadolint",
20+
"omartawfik.github-actions-vscode"
21+
],
22+
23+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
24+
// "forwardPorts": [],
25+
26+
// Use 'postCreateCommand' to run commands after the container is created.
27+
"postCreateCommand": "git config --global core.autocrlf true"
28+
29+
// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
30+
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],
31+
32+
// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
33+
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],
34+
35+
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
36+
// "remoteUser": "vscode"
37+
}

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto eol=lf
2+
*.{cmd,[cC][mM][dD]} text eol=crlf
3+
*.{bat,[bB][aA][tT]} text eol=crlf

.github/workflows/ci.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Docker build and publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build-amd64:
9+
name: Build and publish amd64 image
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Get version
14+
env:
15+
TAG_NAME: ${{ github.event.release.tag_name }}
16+
run: echo "VERSION=${TAG_NAME#v}" >> $GITHUB_ENV
17+
- name: Patch files
18+
uses: onlyutkarsh/patch-files-action@v1.0.1
19+
with:
20+
files: |
21+
lovelace-kindle-screensaver/config.json
22+
patch-syntax: |
23+
= /version => "${{ env.VERSION }}"
24+
- name: publish amd64 docker files
25+
if: github.event_name != 'pull_request'
26+
run: docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v ~/.docker:/root/.docker -v "$(pwd)":/data homeassistant/amd64-builder -t lovelace-kindle-screensaver --amd64 --release-tag --docker-user marciogranzotto --docker-password ${{ secrets.DOCKER_PASSWORD }}
27+
build-armv7:
28+
name: Build and publish armv7 image
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v2
32+
- name: Get version
33+
env:
34+
TAG_NAME: ${{ github.event.release.tag_name }}
35+
run: echo "VERSION=${TAG_NAME#v}" >> $GITHUB_ENV
36+
- name: Patch files
37+
uses: onlyutkarsh/patch-files-action@v1.0.1
38+
with:
39+
files: |
40+
lovelace-kindle-screensaver/config.json
41+
patch-syntax: |
42+
= /version => "${{ env.VERSION }}"
43+
- name: publish armv7 docker files
44+
if: github.event_name != 'pull_request'
45+
run: docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v ~/.docker:/root/.docker -v "$(pwd)":/data homeassistant/amd64-builder -t lovelace-kindle-screensaver --armv7 --release-tag --docker-user marciogranzotto --docker-password ${{ secrets.DOCKER_PASSWORD }}
46+
build-aarch64:
47+
name: Build and publish aarch64 image
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v2
51+
- name: Get version
52+
env:
53+
TAG_NAME: ${{ github.event.release.tag_name }}
54+
run: echo "VERSION=${TAG_NAME#v}" >> $GITHUB_ENV
55+
- name: Patch files
56+
uses: onlyutkarsh/patch-files-action@v1.0.1
57+
with:
58+
files: |
59+
lovelace-kindle-screensaver/config.json
60+
patch-syntax: |
61+
= /version => "${{ env.VERSION }}"
62+
63+
- name: publish aarch64 docker files
64+
if: github.event_name != 'pull_request'
65+
run: docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v ~/.docker:/root/.docker -v "$(pwd)":/data homeassistant/amd64-builder -t lovelace-kindle-screensaver --aarch64 --release-tag --docker-user marciogranzotto --docker-password ${{ secrets.DOCKER_PASSWORD }}
66+
update-main-repo:
67+
needs: [build-amd64, build-armv7, build-aarch64, build-i386, build-armhf]
68+
name: Update addons repository
69+
runs-on: ubuntu-latest
70+
container:
71+
image: hassioaddons/repository-updater:latest
72+
steps:
73+
- name: upload
74+
run: repository-updater --token ${{ secrets.GIT_TOKEN }} --repository marciogranzotto/addons-repository --addon lovelace-kindle-screensaver

.github/workflows/test.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Test Docker build
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
dockerlint:
7+
name: Dockerfile linter
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: hadolint
12+
run: docker run --rm -i hadolint/hadolint < lovelace-kindle-screensaver/Dockerfile
13+
build-amd64:
14+
name: Build amd64 image
15+
runs-on: ubuntu-latest
16+
needs: [dockerlint]
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Patch files
20+
uses: onlyutkarsh/patch-files-action@v1.0.1
21+
with:
22+
files: |
23+
lovelace-kindle-screensaver/config.json
24+
patch-syntax: |
25+
= /version => "${{ github.run_number }}"
26+
- name: build amd64 image
27+
run: docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v ~/.docker:/root/.docker -v "$(pwd)":/data homeassistant/amd64-builder -t lovelace-kindle-screensaver --amd64 --test
28+
build-armv7:
29+
name: Build armv7 image
30+
runs-on: ubuntu-latest
31+
needs: [dockerlint]
32+
steps:
33+
- uses: actions/checkout@v2
34+
- name: Patch files
35+
uses: onlyutkarsh/patch-files-action@v1.0.1
36+
with:
37+
files: |
38+
lovelace-kindle-screensaver/config.json
39+
patch-syntax: |
40+
= /version => "${{ github.run_number }}"
41+
- name: build armv7 image
42+
run: docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v ~/.docker:/root/.docker -v "$(pwd)":/data homeassistant/amd64-builder -t lovelace-kindle-screensaver --armv7 --test
43+
build-aarch64:
44+
name: Build aarch64 image
45+
runs-on: ubuntu-latest
46+
needs: [dockerlint]
47+
steps:
48+
- uses: actions/checkout@v2
49+
- name: Patch files
50+
uses: onlyutkarsh/patch-files-action@v1.0.1
51+
with:
52+
files: |
53+
lovelace-kindle-screensaver/config.json
54+
patch-syntax: |
55+
= /version => "${{ github.run_number }}"
56+
- name: build aarch64 image
57+
run: docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v ~/.docker:/root/.docker -v "$(pwd)":/data homeassistant/amd64-builder -t lovelace-kindle-screensaver --aarch64 --test

.yamllint

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
rules:
3+
braces:
4+
level: error
5+
min-spaces-inside: 0
6+
max-spaces-inside: 1
7+
min-spaces-inside-empty: -1
8+
max-spaces-inside-empty: -1
9+
brackets:
10+
level: error
11+
min-spaces-inside: 0
12+
max-spaces-inside: 0
13+
min-spaces-inside-empty: -1
14+
max-spaces-inside-empty: -1
15+
colons:
16+
level: error
17+
max-spaces-before: 0
18+
max-spaces-after: 1
19+
commas:
20+
level: error
21+
max-spaces-before: 0
22+
min-spaces-after: 1
23+
max-spaces-after: 1
24+
comments:
25+
level: error
26+
require-starting-space: true
27+
min-spaces-from-content: 2
28+
comments-indentation:
29+
level: error
30+
document-end:
31+
level: error
32+
present: false
33+
document-start:
34+
level: error
35+
present: true
36+
empty-lines:
37+
level: error
38+
max: 1
39+
max-start: 0
40+
max-end: 1
41+
hyphens:
42+
level: error
43+
max-spaces-after: 1
44+
indentation:
45+
level: error
46+
spaces: 2
47+
indent-sequences: true
48+
check-multi-line-strings: false
49+
key-duplicates:
50+
level: error
51+
line-length:
52+
level: warning
53+
max: 120
54+
allow-non-breakable-words: true
55+
allow-non-breakable-inline-mappings: true
56+
new-line-at-end-of-file:
57+
level: error
58+
new-lines:
59+
level: error
60+
type: unix
61+
trailing-spaces:
62+
level: error
63+
truthy:
64+
level: error

Dockerfile

Lines changed: 0 additions & 27 deletions
This file was deleted.

docker-compose.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)