blob: 824584c1be43c676d21412f09ddb4e64dbfac468 [file] [log] [blame]
Luigi Santivetti0fdd4702020-06-22 19:00:32 +01001#!/bin/bash
2#
3# help.sh
4#
5# Copyright 2019 Luigi Santivetti <luigi.santivetti@gmail.com>
6
7# Permission is hereby granted, free of charge, to any person obtaining a
8# copy of this software and associated documentation files (the "Software"),
9# to deal in the Software without restriction, including without limitation
10# the rights to use, copy, modify, merge, publish, distribute, sublicense,
11# and/or sell copies of the Software, and to permit persons to whom the
12# Software is furnished to do so, subject to the following conditions:
13
14# The above copyright notice and this permission notice (including the next
15# paragraph) shall be included in all copies or substantial portions of the
16# Software.
17
18# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21# ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
22# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
25function __help
26{
27 cat <<EOF | less -RF
28`printf "\033[1m%s\033[0m\n" "NAME"`
29
30 tod - template open deploy
31
32`printf "\033[1m%s\033[0m\n" "USAGE"`
33
34 [ENVIRONMENT] tod [OPTION]=[MODULE,...]
35
36`printf "\033[1m%s\033[0m\n" "OPTIONS"`
37
38 --check Validate module: module.sh, holder.sh and scheme.sh
39 --watch Diff installed files against templates in scheme.sh
40 --fetch Download MANIFEST mirrors into \$mod_staging_d
41 --doall Make and install module files and \$instance_d files
42 --doins Make and install \$instance_d files, if applicable
43 ignore module files
44 --upall Update module files and \$instance_d files
45 --upins Update \$instance_d files, if applicable ignore module
46 files
47 --upmod Update module files only, do not touch \$instance_d files
48 --clins Uninstall \$instance_d files tracked in uninstall.sh
49 --clmod Remove \$mod_staging_d
50
51`printf "\033[1m%s\033[0m\n" "MODULES"`
52
53`for m in $(get_all_modules); do echo " $m"; done`
54
55`printf "\033[1m%s\033[0m\n" "ENVIRONMENT"`
56
57 LOG_D Default $LOG_D, 1 to show debug logs
58 LOG_W Default $LOG_W, 0 to suppress warning logs
59 LOG_I Default $LOG_I, 0 to suppress info logs
60 LOG_X Default $LOG_X, 0 to suppress logs from sub-process pipes
61 INSTANCE_DIR Default to \$script_dir, which defaults to the tod dir, set it
62 with the path to where an instance is to be created
63 HOST_NAME Default "$def_hostname", instance name
64 PASSWD_F Default null. Only needed for docker-compose and compose-cli.sh.
65 Path to a file containing runtime passwords. This file can be
66 removed after an instance is started
67 DEFANS Default null. Possible values are 'y' or 'n', allows to skip
68 user input when asked
69 MODALL Default 0, 1 to force the use of blacklisted modules. To
70 blacklist a module add it to BLMODULES in config. Blacklisted
71 modules are excluded by the list of modules run by default
72
73 blacklisted modules:
74
75`for m in ${BLMODULES[@]}; do echo " $m"; done`
76
77 INSTANCE_MODE Default "$debug", or "$release". Global switch to enable
78 debug or release version of an instance. Each module is
79 responsible for distinguishing between them. This option
80 can be overridden by module specific MODE. See example [4]
81
82 module specific MODE overrides INSTANCE_MODE:
83
84`for m in $(get_all_modules); do \\
85printf " %-14s %s\n" "${m^^}_MODE" \\
86"Default \\\$INSTANCE_MODE, \"$debug\" or \"$release\"";\\
87 done`
88
89`printf "\033[1m%s\033[0m\n" "EXAMPLES"`
90
91 [1] Call doall on every module, exclude blacklisted modules
92 ./tod --doall
93
94 [2] Force blacklist modules, call doall on test1 only
95 MODALL=1 ./tod --doall=test1
96
97 [3] Force blacklist modules, call doall on test1 and test2
98 MODALL=1 ./tod --doall=test1,test2
99
100 [4] Enable debug logs, make a release instance, but test2 debug
101 LOG_D=1 INSTANCE_MODE=release TEST2_MODE=debug ./tod --doall=test1,test2
102
103`printf "\033[1m%s\033[0m\n" "AUTHORS"`
104
105 Luigi Santivetti
106
107`printf "\033[1m%s\033[0m\n" "REPORTING BUGS"`
108
109 luigi.santivetti@gmail.com
110 https://bitbucket.org/luigi_s/tod
111
112`printf "\033[1m%s\033[0m\n" "VERSION"`
113
114 $credits_vers
115
116`printf "\033[1m%s\033[0m\n" "COPYRIGHT"`
117
118 Copyright 2020
119
120`printf "\033[1m%s\033[0m\n" "END"`
121EOF
122}