update compiler command, add service for ffpapi

This commit is contained in:
jb-alvarado 2022-06-21 18:09:34 +02:00
parent bb60f894ec
commit 529de7bba8
3 changed files with 26 additions and 4 deletions

View File

@ -81,6 +81,11 @@ assets = [
"/usr/bin/ffplayout", "/usr/bin/ffplayout",
"755" "755"
], ],
[
"target/x86_64-unknown-linux-musl/release/ffpapi",
"/usr/bin/ffpapi",
"755"
],
["assets/ffplayout.yml", "/etc/ffplayout/ffplayout.yml", "644"], ["assets/ffplayout.yml", "/etc/ffplayout/ffplayout.yml", "644"],
["assets/logo.png", "/usr/share/ffplayout/logo.png", "644"], ["assets/logo.png", "/usr/share/ffplayout/logo.png", "644"],
["README.md", "/usr/share/doc/ffplayout-engine/README", "644"], ["README.md", "/usr/share/doc/ffplayout-engine/README", "644"],
@ -94,6 +99,7 @@ name = "ffplayout-engine"
license = "GPL-3.0" license = "GPL-3.0"
assets = [ assets = [
{ source = "target/x86_64-unknown-linux-musl/release/ffplayout", dest = "/usr/bin/ffplayout", mode = "755" }, { source = "target/x86_64-unknown-linux-musl/release/ffplayout", dest = "/usr/bin/ffplayout", mode = "755" },
{ source = "target/x86_64-unknown-linux-musl/release/ffpapi", dest = "/usr/bin/ffpapi", mode = "755" },
{ source = "assets/ffplayout.yml", dest = "/etc/ffplayout/ffplayout.yml", mode = "644", config = true }, { source = "assets/ffplayout.yml", dest = "/etc/ffplayout/ffplayout.yml", mode = "644", config = true },
{ source = "assets/ffplayout-engine.service", dest = "/lib/systemd/system/ffplayout-engine.service", mode = "644" }, { source = "assets/ffplayout-engine.service", dest = "/lib/systemd/system/ffplayout-engine.service", mode = "644" },
{ source = "README.md", dest = "/usr/share/doc/ffplayout-engine/README", mode = "644", doc = true }, { source = "README.md", dest = "/usr/share/doc/ffplayout-engine/README", mode = "644", doc = true },

14
assets/ffpapi.service Normal file
View File

@ -0,0 +1,14 @@
[Unit]
Description=Rest API for ffplayout
After=network.target remote-fs.target
[Service]
ExecStart= /usr/bin/ffpapi
ExecReload=/bin/kill -1 $MAINPID
Restart=always
RestartSec=1
User=www-data
Group=www-data
[Install]
WantedBy=multi-user.target

View File

@ -25,16 +25,18 @@ for target in "${targets[@]}"; do
fi fi
cp ./target/${target}/release/ffplayout.exe . cp ./target/${target}/release/ffplayout.exe .
zip -r "ffplayout-engine-v${version}_${target}.zip" assets docs LICENSE README.md ffplayout.exe -x *.db cp ./target/${target}/release/ffpapi.exe .
rm -f ffplayout.exe zip -r "ffplayout-engine-v${version}_${target}.zip" assets docs LICENSE README.md ffplayout.exe ffpapi.exe -x *.db
rm -f ffplayout.exe ffpapi.exe
else else
if [[ -f "ffplayout-engine-v${version}_${target}.tar.gz" ]]; then if [[ -f "ffplayout-engine-v${version}_${target}.tar.gz" ]]; then
rm -f "ffplayout-engine-v${version}_${target}.tar.gz" rm -f "ffplayout-engine-v${version}_${target}.tar.gz"
fi fi
cp ./target/${target}/release/ffplayout . cp ./target/${target}/release/ffplayout .
tar -czvf "ffplayout-engine-v${version}_${target}.tar.gz" --exclude='*.db' assets docs LICENSE README.md ffplayout cp ./target/${target}/release/ffpapi .
rm -f ffplayout tar -czvf "ffplayout-engine-v${version}_${target}.tar.gz" --exclude='*.db' assets docs LICENSE README.md ffplayout ffpapi
rm -f ffplayout ffpapi
fi fi
echo "" echo ""