1
0
Fork 0
mirror of https://gitlab.com/futo-org/fcast.git synced 2025-06-24 21:25:23 +00:00

webOS: Added Docker container for local development

This commit is contained in:
Michael Hollister 2025-05-07 18:12:38 -05:00
parent 69500c19e9
commit 96f63f4c3e
7 changed files with 72 additions and 29 deletions

View file

@ -1,4 +1,5 @@
fcast-receiver/dist fcast-receiver/dist
fcast-receiver-service/dist fcast-receiver-service/dist
.env
*.ipk *.ipk

View file

@ -1,21 +1,19 @@
buildWebOS: buildWebOS:
stage: buildWebOSReceiver stage: buildWebOSReceiver
image: node:22.11.0-bookworm image: node:16.20.2-bullseye
tags: tags:
- fcast-instance-runner - fcast-instance-runner
before_script: before_script:
- cd receivers/webos - cd receivers/webos
- npm install -g @webos-tools/cli - npm install -g @webos-tools/cli
script:
- cd fcast-receiver - cd fcast-receiver
- npm install - npm install
- npm run build
- cd ../fcast-receiver-service - cd ../fcast-receiver-service
- npm install - npm install
- npm run build - cd ..
- cd ../ script:
- ares-package fcast-receiver/dist/ fcast-receiver-service/dist/ --no-minify - scripts/build.sh
artifacts: artifacts:
untracked: false untracked: false
when: on_success when: on_success

View file

@ -0,0 +1,12 @@
FROM node:16.20.2-bullseye
ARG TV_IP
ARG PASSPHRASE
RUN apt update && apt install -y expect jq
RUN npm install -g @webos-tools/cli
RUN ares-setup-device --add tv --info "host=${TV_IP}" --info "default=true"
COPY scripts/get_private_key.sh .
RUN ./get_private_key.sh ares-novacom --device tv --getkey

View file

@ -6,33 +6,38 @@ The TV receiver player is a simplified player compared to the Electron receiver
# How to build # How to build
From `receivers/webos` directory: ## Preparing for build
## Prerequisites A docker file is provided to setup your build and debug environment for a local TV device. From the root of the repository:
```sh
npm install -g @webos-tools/cli ### Build
cd fcast-receiver ```bash
npm install source receivers/webos/.env && docker build -t fcast/receiver-webos-dev:latest \
cd ../fcast-receiver-service --build-arg TV_IP=$TV_IP --build-arg PASSPHRASE=$PASSPHRASE receivers/webos/
npm install
cd ../
``` ```
## Build Note that you must have the key server enabled during the build process.
```sh
cd fcast-receiver To populate the container build arguments, you must export the following environment variables or set them in your `.env` file in `receivers/webos/.env`:
npm run build ```
cd ../fcast-receiver-service TV_IP=YOUR_TV_IP_ADDRESS
npm run build PASSPHRASE=YOUR_TV_PASSPHRASE
cd ../
``` ```
## Packaging This information is found in the development app.
```sh
ares-package fcast-receiver/dist/ fcast-receiver-service/dist/ --no-minify ### Run
```bash
docker run --rm -it -w /app/receivers/webos --entrypoint='bash' --network host \
-v .:/app fcast/receiver-webos-dev:latest
``` ```
## Debugging Note that you must enable host networking support in your docker engine. Also, the production application
* Install: `ares-install --device tv ./com.futo.fcast.receiver_1.0.0_all.ipk` from the LG store must be uninstalled in order to run and debug the development version.
* Web app debug: `ares-inspect --device tv --app com.futo.fcast.receiver -o`
* Service debug: `ares-inspect --device tv -s com.futo.fcast.receiver.service` ## Commands
* Build app: `scripts/build.sh`
* Debug app: `scripts/debug.sh`
Build artifact .ipk will be located in `receivers/webos`

View file

@ -0,0 +1,9 @@
#!/bin/bash
cd fcast-receiver
npm run build
cd ../fcast-receiver-service
npm run build
cd ../
ares-package fcast-receiver/dist/ fcast-receiver-service/dist/ --no-minify

View file

@ -0,0 +1,9 @@
#!/bin/bash
version=$(jq -r '.version' fcast-receiver/package.json)
scripts/build.sh
ares-install --device tv ./com.futo.fcast.receiver_${version}_all.ipk
ares-inspect --device tv -s com.futo.fcast.receiver.service &
sleep 5
ares-inspect --device tv --app com.futo.fcast.receiver

View file

@ -0,0 +1,9 @@
#!/usr/bin/expect -f
set timeout -1
spawn {*}$argv
expect "SSH Private Key: /root/.ssh/tv_webos"
send -- "$env(PASSPHRASE)\n"
expect eof