comparison scripts/Docker/roundup_start @ 6555:34cbd0e633d2

Added FastCGI deployment info, updated Docker docs; docker-compose added This moves the Docker files to the subdirectory scripts/Docker. Attempted to provide a slightly guided install of a tracker using the roundup_start script It include the docker-compose.yml file donated by Norbert Schlemmer. Hopefully I didn't break it when modifying it for it's new home.
author John Rouillard <rouilj@ieee.org>
date Sun, 12 Dec 2021 19:19:52 -0500
parents
children b5fb268b7f04
comparison
equal deleted inserted replaced
6554:576d630fc908 6555:34cbd0e633d2
1 #! /bin/sh
2
3 # When container starts verify that the trackers are configured.
4 # If they are, start the server otherwise run roundup-admin
5 # for installation and initialization.
6
7 # "$@" should be a set of tracker=directory pairs.
8
9 set -xv
10
11 trap exit INT
12
13 do_exit=0
14
15 for tracker_spec in "$@"; do
16 # IFS== set a=b doesn't assign $1 and $2 in busybox ash
17 # it also clobbers '$@'. 'echo mumble | read' starts read in a
18 # subshell so vars are not available in parent.
19 IFS="=" read tracker directory <<- EOE
20 $tracker_spec
21 EOE
22 # ^ is a tab for use with <<-
23
24 # was $tracker_spec in the form of a=b, if not ignore it.
25 # allows setting CMD to -p 9090 issue=tracker for example.
26 if [ -z "$directory" ]; then continue; fi
27
28 # something is specified or built wrong. Don't start.
29 if [ ! -d "$directory" ]; then
30 printf "Unable to find directory %s. Exiting\n" "$directory"
31 exit 1
32 fi
33
34 # user must define web in config.ini.
35 if ! grep '^\s*web\s\s*=\s\s*' "$directory/config.ini" > /dev/null; then
36 roundup-admin -i "$directory" install
37 do_exit=1
38 fi
39
40 # we have a valid config.ini so init database if not done
41 if [ $do_exit == 0 -a ! -e "$directory/.init_done" ]; then
42 if roundup-admin -i "$directory" init; then
43 cat > "$directory/.init_done" <<- EOD
44 Don't delete this file. The docker startup needs it so it won't
45 re-initialze the database destroying all the data.
46 EOD
47 else
48 do_exit=1
49 fi
50 fi
51 done
52
53 # if any config.ini needs editing don't start up.
54 if [ $do_exit == 0 ]; then
55 # make roundup-server process 1 with exec
56 exec roundup-server -n 0.0.0.0 "$@"
57 fi
58
59 exit 0

Roundup Issue Tracker: http://roundup-tracker.org/