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:
parent
69500c19e9
commit
96f63f4c3e
7 changed files with 72 additions and 29 deletions
1
receivers/webos/.gitignore
vendored
1
receivers/webos/.gitignore
vendored
|
@ -1,4 +1,5 @@
|
|||
fcast-receiver/dist
|
||||
fcast-receiver-service/dist
|
||||
|
||||
.env
|
||||
*.ipk
|
||||
|
|
|
@ -1,21 +1,19 @@
|
|||
|
||||
buildWebOS:
|
||||
stage: buildWebOSReceiver
|
||||
image: node:22.11.0-bookworm
|
||||
image: node:16.20.2-bullseye
|
||||
tags:
|
||||
- fcast-instance-runner
|
||||
before_script:
|
||||
- cd receivers/webos
|
||||
- npm install -g @webos-tools/cli
|
||||
script:
|
||||
- cd fcast-receiver
|
||||
- npm install
|
||||
- npm run build
|
||||
- cd ../fcast-receiver-service
|
||||
- npm install
|
||||
- npm run build
|
||||
- cd ../
|
||||
- ares-package fcast-receiver/dist/ fcast-receiver-service/dist/ --no-minify
|
||||
- cd ..
|
||||
script:
|
||||
- scripts/build.sh
|
||||
artifacts:
|
||||
untracked: false
|
||||
when: on_success
|
||||
|
|
12
receivers/webos/Dockerfile
Normal file
12
receivers/webos/Dockerfile
Normal 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
|
|
@ -6,33 +6,38 @@ The TV receiver player is a simplified player compared to the Electron receiver
|
|||
|
||||
# How to build
|
||||
|
||||
From `receivers/webos` directory:
|
||||
## Preparing for build
|
||||
|
||||
## Prerequisites
|
||||
```sh
|
||||
npm install -g @webos-tools/cli
|
||||
cd fcast-receiver
|
||||
npm install
|
||||
cd ../fcast-receiver-service
|
||||
npm install
|
||||
cd ../
|
||||
A docker file is provided to setup your build and debug environment for a local TV device. From the root of the repository:
|
||||
|
||||
### Build
|
||||
```bash
|
||||
source receivers/webos/.env && docker build -t fcast/receiver-webos-dev:latest \
|
||||
--build-arg TV_IP=$TV_IP --build-arg PASSPHRASE=$PASSPHRASE receivers/webos/
|
||||
```
|
||||
|
||||
## Build
|
||||
```sh
|
||||
cd fcast-receiver
|
||||
npm run build
|
||||
cd ../fcast-receiver-service
|
||||
npm run build
|
||||
cd ../
|
||||
Note that you must have the key server enabled during the build process.
|
||||
|
||||
To populate the container build arguments, you must export the following environment variables or set them in your `.env` file in `receivers/webos/.env`:
|
||||
```
|
||||
TV_IP=YOUR_TV_IP_ADDRESS
|
||||
PASSPHRASE=YOUR_TV_PASSPHRASE
|
||||
```
|
||||
|
||||
## Packaging
|
||||
```sh
|
||||
ares-package fcast-receiver/dist/ fcast-receiver-service/dist/ --no-minify
|
||||
This information is found in the development app.
|
||||
|
||||
### Run
|
||||
```bash
|
||||
docker run --rm -it -w /app/receivers/webos --entrypoint='bash' --network host \
|
||||
-v .:/app fcast/receiver-webos-dev:latest
|
||||
```
|
||||
|
||||
## Debugging
|
||||
* Install: `ares-install --device tv ./com.futo.fcast.receiver_1.0.0_all.ipk`
|
||||
* 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`
|
||||
Note that you must enable host networking support in your docker engine. Also, the production application
|
||||
from the LG store must be uninstalled in order to run and debug the development version.
|
||||
|
||||
## Commands
|
||||
|
||||
* Build app: `scripts/build.sh`
|
||||
* Debug app: `scripts/debug.sh`
|
||||
|
||||
Build artifact .ipk will be located in `receivers/webos`
|
||||
|
|
9
receivers/webos/scripts/build.sh
Executable file
9
receivers/webos/scripts/build.sh
Executable 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
|
9
receivers/webos/scripts/debug.sh
Executable file
9
receivers/webos/scripts/debug.sh
Executable 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
|
9
receivers/webos/scripts/get_private_key.sh
Executable file
9
receivers/webos/scripts/get_private_key.sh
Executable 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
|
Loading…
Add table
Add a link
Reference in a new issue