kapsikkum-unmanic – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 #!/bin/bash
2 # -*- coding: utf-8 -*-
3 ###################################################################################################
4 #
5 # Written by: Josh.5 <jsunnex@gmail.com>
6 # Date: Thu Jan 07 2019, (17:59:00 PM)
7 #
8 # Copyright:
9 # Copyright (C) Josh Sunnex - All Rights Reserved
10 #
11 # Permission is hereby granted, free of charge, to any person obtaining a copy
12 # of this software and associated documentation files (the "Software"), to deal
13 # in the Software without restriction, including without limitation the rights
14 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 # copies of the Software, and to permit persons to whom the Software is
16 # furnished to do so, subject to the following conditions:
17 #
18 # The above copyright notice and this permission notice shall be included in all
19 # copies or substantial portions of the Software.
20 #
21 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25 # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
26 # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
27 # OR OTHER DEALINGS IN THE SOFTWARE.
28 #
29 #
30 ###################################################################################################
31  
32  
33 SCRIPT_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd );
34 PROJECT_BASE=$(realpath ${SCRIPT_PATH}/../../);
35 TEST_VIDEOS_DIRECTORY=$(realpath ${SCRIPT_PATH}/../support_/videos);
36 TEMP_ENV=$(realpath ${SCRIPT_PATH}/../tmp/test_env);
37 PUID=$(id -u);
38 PGID=$(id -g);
39  
40 source "${SCRIPT_PATH}/download_test_files.sh"
41  
42 # Setup folders:
43 rm -rf ${TEMP_ENV}/library/path*
44 mkdir -p \
45 ${TEMP_ENV}/library/path1 \
46 ${TEMP_ENV}/library/path2 \
47 ${TEMP_ENV}/library/path3 \
48 ${TEMP_ENV}/library/path4
49  
50  
51 # Copy test files to test folders
52 cp -r ${TEST_VIDEOS_DIRECTORY}/small/* ${TEMP_ENV}/library/path1/
53 cp -r ${TEST_VIDEOS_DIRECTORY}/small/* ${TEMP_ENV}/library/path2/
54 cp -r ${TEST_VIDEOS_DIRECTORY}/small/* ${TEMP_ENV}/library/path3/
55 cp -r ${TEST_VIDEOS_DIRECTORY}/small/* ${TEMP_ENV}/library/path4/
56  
57  
58 # Set the config for the application so that it scans for files right away
59 DEBUGGING=${DEBUGGING:-true}
60 NUMBER_OF_WORKERS=${NUMBER_OF_WORKERS:-1}
61 SCHEDULE_FULL_SCAN_MINUTES=${SCHEDULE_FULL_SCAN_MINUTES:-10}
62 RUN_FULL_SCAN_ON_START=${RUN_FULL_SCAN_ON_START:-true}
63  
64  
65 # Parse args
66 for arg in ${@}; do
67 # If clean is passed, clear out the config prior to running
68 if [[ ${arg} =~ '--clean' ]]; then
69 rm -rf ${TEMP_ENV}/config;
70 fi
71 done
72  
73  
74 # Run container
75 docker run -ti --rm \
76 -p 8888:8888 \
77 -v ${PROJECT_BASE}/:/app \
78 -v ${TEMP_ENV}/cache:/tmp/unmanic \
79 -v ${TEMP_ENV}/library:/library \
80 -v ${TEMP_ENV}/config:/config \
81 -e PUID=${PUID} \
82 -e PGID=${PGID} \
83 -e DEBUGGING=${DEBUGGING} \
84 -e NUMBER_OF_WORKERS=${NUMBER_OF_WORKERS} \
85 -e SCHEDULE_FULL_SCAN_MINUTES=${SCHEDULE_FULL_SCAN_MINUTES} \
86 -e RUN_FULL_SCAN_ON_START=${RUN_FULL_SCAN_ON_START} \
87 josh5/unmanic bash
88