Skip to content
GitLab
Explore
Sign in
libre.sh
docker
compile-owncast
Compare revisions
83d5fcb07e73b0b8338680292dc1742f0325855c to 720dc846f4a71cdfe9113cc1e6abc8494887a56f
Commits on Source (2)
Adds gitignore.
· f3823a03
Pierre Ozoux
authored
Aug 31, 2021
f3823a03
Makes it work :)
· 720dc846
Pierre Ozoux
authored
Aug 31, 2021
720dc846
Hide whitespace changes
Inline
Side-by-side
.gitignore
0 → 100644
View file @
720dc846
.env
\ No newline at end of file
compile.sh
View file @
720dc846
...
...
@@ -3,7 +3,7 @@
export
MC_HOST_minio
=
https://
${
AWS_ACCESS_KEY_ID
}
:
${
AWS_SECRET_ACCESS_KEY
}
@
${
S3_ENDPOINT
}
for
i
in
`
mc
ls
minio/
${
BUCKET
}
/hls/0/ |
grep
-o
"stream-
$STREAM_ID
.*.ts"
`
;
do
echo
file
${
S3_ENDPOINT
}
/
$BUCKET
/hls/0/
$i
;
echo
file
https://
${
S3_ENDPOINT
}
/
$BUCKET
/hls/0/
$i
;
done
>
/tmp/allts
...
...
cronjob.yml
View file @
720dc846
...
...
@@ -41,7 +41,7 @@ metadata:
rules
:
-
apiGroups
:
[
"
batch"
]
resources
:
[
"
jobs"
]
verbs
:
[
"
create"
]
verbs
:
[
"
get"
,
"
create"
]
---
apiVersion
:
rbac.authorization.k8s.io/v1
kind
:
RoleBinding
...
...
job.yml
View file @
720dc846
apiVersion
:
batch/v1
kind
:
Job
metadata
:
name
:
compile-${
STREAM_ID
}
name
:
compile-${
NAME
}
spec
:
template
:
spec
:
...
...
@@ -18,6 +18,6 @@ spec:
name
:
${BUCKET}
image
:
libresh/compile-owncast
imagePullPolicy
:
IfNotPresent
name
:
compile-${
STREAM_ID
}
name
:
compile-${
NAME
}
restartPolicy
:
Never
start-jobs.sh
View file @
720dc846
...
...
@@ -5,13 +5,18 @@ mc cp minio/${BUCKET}/hls/0/stream.m3u8 /tmp/stream.m3u8
if
cat
/tmp/stream.m3u8 |
grep
offline
;
then
echo
not live
;
export
LIVE_STREAM_ID
=
"
"
export
FILTER
=
"offline
\|
m3u8
"
else
echo
stream is live
;
export
LIVE_STREAM_ID
=
`
cat
/tmp/stream.m3u8 |
grep
-v
offline |
grep
stream |
head
-c
16 |
tail
-c
9
`
export
FILTER
=
"
$LIVE_STREAM_ID
\|
offline
\|
m3u8"
fi
for
STREAM_ID
in
`
mc
ls
minio/
${
BUCKET
}
/hls/0/ |
grep
-v
"
$LIVE_STREAM_ID
\|
offline
\|
m3u8"
|
cut
-d
"-"
-f4
|
cut
-c-9
|
uniq
`
;
do
for
ID
in
`
mc
ls
minio/
${
BUCKET
}
/hls/0/ |
grep
-v
"
$FILTER
"
|
cut
-d
"-"
-f4
|
cut
-c-9
|
uniq
`
;
do
echo
"Gonna compile stream
$ID
..."
export
STREAM_ID
=
$ID
export
NAME
=
`
echo
$ID
tr
'[:upper:]'
'[:lower:]'
`
cat
./job.yml | envsubst | kubectl apply
-f
-
echo
"Job started"
done