Skip to content

Commit 6dd0dde

Browse files
committed
ci: taskfile & task for updating camera-streamer packages
1 parent c3db0fc commit 6dd0dde

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Taskfile.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: "3"
2+
3+
vars:
4+
CAMERA_STREAMER: ayufan/camera-streamer
5+
6+
tasks:
7+
update-camera-streamer:
8+
cmds:
9+
- |
10+
TAG="{{.TAG}}"
11+
if [ "$TAG" == "latest" ]; then
12+
TAG=$(curl -sL https://api.github.com/repos/{{.CAMERA_STREAMER}}/releases/latest | jq -r '.tag_name')
13+
fi
14+
15+
URL="https://api.github.com/repos/{{.CAMERA_STREAMER}}/releases/tags/$TAG"
16+
echo "Fetching release information for $TAG from $URL"
17+
18+
for url in $(curl -sL $URL | jq -r '.assets[].browser_download_url' | grep "camera-streamer-raspi.*\.deb");
19+
do
20+
echo $url
21+
name=$(echo $url | cut -d/ -f9)
22+
distro=$(echo $name | rev | cut -d. -f2 | rev | cut -d_ -f1)
23+
arch=$(echo $name | rev | cut -d. -f2 | rev | cut -d_ -f2)
24+
25+
dir=pool/$distro/rpi/camera-streamer-raspi
26+
if [ -d $dir ]; then
27+
echo "Downloading $url to $name..."
28+
pushd $dir
29+
curl -LJ "$url" > "$name"
30+
popd
31+
fi
32+
done
33+
vars:
34+
TAG: '{{.TAG|default "latest"}}'

0 commit comments

Comments
 (0)