-
Notifications
You must be signed in to change notification settings - Fork 0
/
define-text2talk.sh
71 lines (67 loc) · 1.73 KB
/
define-text2talk.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
#
# Copyright 2021 Nubonetics Solutions Inc.
# SPDX-License-Identifier: Apache 2.0
function text2pdf {
ARGS=$@
echo pandoc $ARGS
docker run \
-h text2talk \
--detach \
--name text2talk \
--env COLORFGBG \
--env EMAIL \
--env TERM \
--env USER=${USER} \
--env GROUP=${USER} \
--env USER_ID=`id -u ${USER}` \
--env GROUP_ID=`getent group ${USER} | awk -F: '{printf $3}'` \
-v ${PWD}:/workspace \
--env DISPLAY \
--env VIDEO_GROUP_ID=`getent group video | awk -F: '{printf $3}'` \
-v /home/${USER}/.aws:/home/${USER}/.aws:ro \
--cap-add=SYS_PTRACE \
--net=host \
--privileged \
--add-host text2talk:127.0.0.1 \
nubonetics/text2talk:latest >> /dev/null
sleep 1
docker exec -t --env COLORFGBG --env TERM -u ${USER} text2talk /bin/bash -lc "cd /workspace; pandoc $ARGS"
docker stop text2talk >> /dev/null
docker rm text2talk >> /dev/null
}
export -f text2pdf
function pdf2talk {
ARGS=$@
echo pdf2video $ARGS
docker run \
-h text2talk \
--detach \
--name text2talk \
--env COLORFGBG \
--env EMAIL \
--env TERM \
--env USER=${USER} \
--env GROUP=${USER} \
--env USER_ID=`id -u ${USER}` \
--env GROUP_ID=`getent group ${USER} | awk -F: '{printf $3}'` \
--env AWS_ACCESS_KEY_ID \
--env AWS_SECRET_ACCESS_KEY \
--env AWS_DEFAULT_REGION \
--env AWS_REGION \
--env AWS_PROFILE \
-v ${PWD}:/workspace \
--env DISPLAY \
--env VIDEO_GROUP_ID=`getent group video | awk -F: '{printf $3}'` \
-v /home/${USER}/.aws:/home/${USER}/.aws:ro \
--cap-add=SYS_PTRACE \
--net=host \
--privileged \
--add-host text2talk:127.0.0.1 \
nubonetics/text2talk:latest >> /dev/null
sleep 1
docker exec -t --env COLORFGBG --env TERM -u ${USER} text2talk /bin/bash -lc "cd /workspace; pdf2video $ARGS"
docker stop text2talk >> /dev/null
docker rm text2talk >> /dev/null
}
export -f pdf2talk