Luigi Santivetti | 0fdd470 | 2020-06-22 19:00:32 +0100 | [diff] [blame] | 1 | #!/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 | |
| 25 | function __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 |
Luigi Santivetti | 35de206 | 2020-10-26 09:40:09 +0000 | [diff] [blame] | 72 | MANIFEST_F Default MANIFEST. Path to the MANIFEST file tod should source |
| 73 | and use to fetch external repositories |
Luigi Santivetti | 0fdd470 | 2020-06-22 19:00:32 +0100 | [diff] [blame] | 74 | |
| 75 | blacklisted modules: |
| 76 | |
| 77 | `for m in ${BLMODULES[@]}; do echo " $m"; done` |
| 78 | |
| 79 | INSTANCE_MODE Default "$debug", or "$release". Global switch to enable |
| 80 | debug or release version of an instance. Each module is |
| 81 | responsible for distinguishing between them. This option |
| 82 | can be overridden by module specific MODE. See example [4] |
| 83 | |
| 84 | module specific MODE overrides INSTANCE_MODE: |
| 85 | |
| 86 | `for m in $(get_all_modules); do \\ |
| 87 | printf " %-14s %s\n" "${m^^}_MODE" \\ |
| 88 | "Default \\\$INSTANCE_MODE, \"$debug\" or \"$release\"";\\ |
| 89 | done` |
| 90 | |
| 91 | `printf "\033[1m%s\033[0m\n" "EXAMPLES"` |
| 92 | |
| 93 | [1] Call doall on every module, exclude blacklisted modules |
| 94 | ./tod --doall |
| 95 | |
| 96 | [2] Force blacklist modules, call doall on test1 only |
| 97 | MODALL=1 ./tod --doall=test1 |
| 98 | |
| 99 | [3] Force blacklist modules, call doall on test1 and test2 |
| 100 | MODALL=1 ./tod --doall=test1,test2 |
| 101 | |
| 102 | [4] Enable debug logs, make a release instance, but test2 debug |
| 103 | LOG_D=1 INSTANCE_MODE=release TEST2_MODE=debug ./tod --doall=test1,test2 |
| 104 | |
| 105 | `printf "\033[1m%s\033[0m\n" "AUTHORS"` |
| 106 | |
| 107 | Luigi Santivetti |
| 108 | |
| 109 | `printf "\033[1m%s\033[0m\n" "REPORTING BUGS"` |
| 110 | |
| 111 | luigi.santivetti@gmail.com |
| 112 | https://bitbucket.org/luigi_s/tod |
| 113 | |
| 114 | `printf "\033[1m%s\033[0m\n" "VERSION"` |
| 115 | |
| 116 | $credits_vers |
| 117 | |
| 118 | `printf "\033[1m%s\033[0m\n" "COPYRIGHT"` |
| 119 | |
| 120 | Copyright 2020 |
| 121 | |
| 122 | `printf "\033[1m%s\033[0m\n" "END"` |
| 123 | EOF |
| 124 | } |