-
Notifications
You must be signed in to change notification settings - Fork 3
/
process-videos.mcd
executable file
·36 lines (30 loc) · 1.19 KB
/
process-videos.mcd
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
#!/usr/bin/env bash
# @from Dockerfile
# @group Personal
# @description Concats all the videos in the provided folder and pushes them to Youtube
# @user root
# @needs_tty true
# @version 0.1.0
# @enable_dynamic_volume_mounts true
# @vol ~/.config/youtube:/config/youtube:ro
# @vol ~/.timewarrior:/config/timewarrior:ro
# NOTE: this is run using an application I developed which is not open source
# yet. So better to just run `docker build .` and run with docker.
set -euo pipefail
if [ $UID -eq 0 ] && [ -f /.dockerenv ]; then
# if this is executed as root inside a docker container
# then align with host user and group and re-launch
/app/align-users.sh temp_user temp_group
exec su -s /bin/bash temp_user "$0" -- "$@"
fi
# These are mounted on read-only-mode for security
# so I copied them inside the container to make them writable
cp -r /config/timewarrior ~/.timewarrior
cp -r /config/youtube /tmp/.youtube
# arguments parsing
. /app/argsparse.sh
argsparse_use_option =rec-dir: "Directory of the recordings to process" mandatory
argsparse_parse_options "$@"
directory=${program_options[rec-dir]}
# Run script that merges and uploads the video
python3 /app/upload-recordings.py "$directory"