Update first_time_setup to allow taking parameters on the commandline #84
Labels
enhancement
future
For deferred issues (which will not be worked on yet, but are worth implementing someday)
quality-of-life
Small issues which don't add functionality, but improve things from a development standpoint
shell
Issues or pull requests which involve changes to the Bash shell scripts supporting the bot
In order to support more automated flows, as well as a variety of environments, enhance first_time_setup to support taking input on the commandline rather than stdin.
--type=[dev|test|prod]
controls the server configurationdev
includes dev dependencies, but not hook setup.test
sets 'NODE_ENV=production' in the bashrc and before running setup, to avoid installing dev dependencies. It also skips hook setup.prod
, which is the default, will set production node_env, and will configure npm hooks to ensure dependencies are always up to date. It also sets the default value of autostart-on-reboot to 'yes'--unattended
will skip all prompts, and will proceed with whatever option does not require input or whatever the default option is for the setting at hand if no input is required at all. That is to say, unless options are provided on the commandline:--unattended
was not passed):--[no-]log-mailing
(on/off switch, on implied by presence of either of the other two)--mail-to=<email>
(sets the address to send logs to<email>
)--mail-subject=<prefix>
(sets the mail prefix to<prefix>
)--no-auth-token
(disables setup of auth token)--auth-token
(prompts for token)--auth-token=<token>
(configured auth with<token>
)--no-timezone
(disables setup of timezone)--timezone
(prompts for timezone)--timezone=<TZ>
(configures bashrc with<TZ>
)--[no-]start-on-boot
(on/off switch for start-on-boot - Should this be--autostart
?)The end goal is that one could theoretically perform a setup by remote invocation of something like:
/path/to/CadenceBot/first_time_setup.sh --type=prod --unattended --mail-to=me@example.com --mail-subject=CadenceBot \ --auth-token=$(cat prod-token) --timezone=America/Chicago
Don't forget to document all of this in the usage!
The text was updated successfully, but these errors were encountered: