-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Dockerfile build pipeline (#2)
* format .vscode/tasks.json * Add dockerfile to CI * Fix github actions * Add docker-bake.hcl * Set up buildx in CI * Build out initial release steps * Fix yamllint rules
- Loading branch information
Showing
9 changed files
with
174 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
name: Perform a release | ||
|
||
on: [workflow_dispatch] # yamllint disable-line rule:truthy | ||
jobs: | ||
build-images: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- id: version | ||
name: Get version string | ||
run: echo "::set-output name=VERSION::v$(date +'+%Y.%m.%d').${{ github.run_number }}" | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.version.outputs.VERSION }} | ||
release_name: Release ${{ github.ref }} | ||
draft: true | ||
prerelease: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
name: Test image build | ||
|
||
on: [push] # yamllint disable-line rule:truthy | ||
jobs: | ||
build-images: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: "Build images" | ||
run: | | ||
docker buildx bake ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "infinitude-src"] | ||
path = infinitude-src | ||
url = https://github.com/nebulous/infinitude |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Start Home Assistant", | ||
"type": "shell", | ||
"command": "supervisor_run", | ||
"group": { | ||
"kind": "test", | ||
"isDefault": true | ||
}, | ||
"presentation": { | ||
"reveal": "always", | ||
"panel": "new" | ||
}, | ||
"problemMatcher": [] | ||
} | ||
] | ||
} | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Start Home Assistant", | ||
"type": "shell", | ||
"command": "supervisor_run", | ||
"group": { | ||
"kind": "test", | ||
"isDefault": true | ||
}, | ||
"presentation": { | ||
"reveal": "always", | ||
"panel": "new" | ||
}, | ||
"problemMatcher": [] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
extends: default | ||
|
||
rules: | ||
line-length: disable | ||
|
||
ignore: | ||
- infinitude-src/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
variable "VERSION" { | ||
} | ||
|
||
target "ci" { | ||
pull = true | ||
|
||
platforms = ["linux/amd64", "linux/arm64"] | ||
|
||
context = "docker" | ||
} | ||
|
||
target "infinitude" { | ||
pull = true | ||
|
||
platforms = ["linux/amd64", "linux/arm64"] | ||
|
||
context = "infinitude-src" | ||
|
||
tags = [ | ||
"docker.io/sosheskaz/infinitude:${VERSION}", | ||
] | ||
|
||
} | ||
|
||
target "release" { | ||
pull = true | ||
|
||
platforms = ["linux/amd64", "linux/arm64"] | ||
|
||
context { | ||
dockerfile = "Dockerfile" | ||
} | ||
|
||
tags = [ | ||
"docker.io/sosheskaz/ha-infinitude:${VERSION}", | ||
// "docker.io/sosheskaz/ha-infinitude:latest" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM docker.io/nebulous/infinitude:latest | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
bash \ | ||
jq \ | ||
tini \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY run.sh / | ||
|
||
MAINTAINER "Eric Miller (sosheskaz)" | ||
|
||
ENTRYPOINT ["tini", "--", "/run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
CONFIG_PATH=/data/options.json | ||
|
||
cfg() { | ||
jq -r --arg key "$1" '.[$key]' < "${CONFIG_PATH}" | ||
} | ||
|
||
MODE="$(cfg 'mode')" | ||
|
||
if [[ "${MODE}" = "Development" ]] | ||
then | ||
set -x | ||
fi | ||
|
||
APP_SECRET="$(cfg 'app_secret')" | ||
PASS_REQS="$(cfg 'pass_reqs')" | ||
SERIAL_TTY="$(cfg 'serial_tty')" | ||
SERIAL_SOCKET="$(cfg 'serial_socket')" | ||
|
||
CFG="$(jq -s \ | ||
--arg APP_SECRET "${APP_SECRET}" \ | ||
--argjson PASS_REQS "${PASS_REQS}" \ | ||
'{"app_secret":$APP_SECRET,"pass_reqs":$PASS_REQS}' \ | ||
< /dev/null)" | ||
|
||
if [[ -n "${SERIAL_TTY}" ]] | ||
then | ||
CFG="$(jq \ | ||
--arg SERIAL_TTY "${SERIAL_TTY}" \ | ||
'. + {"serial_tty":$SERIAL_TTY}' \ | ||
<<< "${CFG}")" | ||
fi | ||
|
||
if [[ -n "${SERIAL_SOCKET}" ]] | ||
then | ||
CFG="$(jq \ | ||
--arg SERIAL_SOCKET "${SERIAL_SOCKET}" \ | ||
'. + {"serial_tty":$SERIAL_SOCKET}' \ | ||
<<< "${CFG}")" | ||
fi | ||
|
||
echo "${CFG}" > /infinitude/infinitude.json | ||
|
||
rm -rf /infinitude/state | ||
mkdir -p /data/infinitude/state | ||
ln -sfT /data/infinitude/state /infinitude/state | ||
|
||
cd /infinitude | ||
exec ./infinitude daemon -m "${MODE}" "$@" |
Submodule infinitude-src
added at
690f68