Updated start script environment variables

This commit is contained in:
Brian Zalewski 2023-05-30 02:46:47 +00:00
parent 36e0de2337
commit 2ef9793998
2 changed files with 23 additions and 18 deletions

View file

@ -39,7 +39,7 @@
# #
# | Variable | Description | # | Variable | Description |
# |------------------------|-----------------------------------------------------------------------------------| # |------------------------|-----------------------------------------------------------------------------------|
# | `START_REPO` | Variable to specify the Git fork to use when provisioning | # | `START_REPO` (or `REPO`) | Variable to specify the Git fork to use when provisioning |
# | `ANSIBLE_PROVISION_VM` | **For Qubes**, determines the name of the VM used to provision the system | # | `ANSIBLE_PROVISION_VM` | **For Qubes**, determines the name of the VM used to provision the system |
# | `DEBUG_MODE` | Set to true to enable verbose logging | # | `DEBUG_MODE` | Set to true to enable verbose logging |
# #
@ -56,7 +56,7 @@ export DEBIAN_FRONTEND=noninteractive
# @description Detect `START_REPO` format and determine appropriate git address, otherwise use the master Install Doctor branch # @description Detect `START_REPO` format and determine appropriate git address, otherwise use the master Install Doctor branch
if [ -z "$START_REPO" ]; then if [ -z "$START_REPO" ]; then
START_REPO="https://gitlab.com/megabyte-labs/install.doctor.git" START_REPO="https://github.com/megabyte-labs/install.doctor.git"
else else
if [[ "$START_REPO == *"/"* ]]; then if [[ "$START_REPO == *"/"* ]]; then
# Either full git address or GitHubUser/RepoName # Either full git address or GitHubUser/RepoName

View file

@ -37,11 +37,11 @@
# environment variables, this script can be run completely headlessly. This allows us to do things like test our # environment variables, this script can be run completely headlessly. This allows us to do things like test our
# provisioning script on a wide variety of operating systems. # provisioning script on a wide variety of operating systems.
# #
# | Variable | Description | # | Variable | Description |
# |------------------------|-----------------------------------------------------------------------------------| # |---------------------------|-----------------------------------------------------------------------------------|
# | `START_REPO` | Variable to specify the Git fork to use when provisioning | # | `START_REPO` (or `REPO`) | Variable to specify the Git fork to use when provisioning |
# | `ANSIBLE_PROVISION_VM` | **For Qubes**, determines the name of the VM used to provision the system | # | `ANSIBLE_PROVISION_VM` | **For Qubes**, determines the name of the VM used to provision the system |
# | `DEBUG_MODE` | Set to true to enable verbose logging | # | `DEBUG_MODE` (or `DEBUG`) | Set to true to enable verbose logging |
# #
# For a full list of variables you can use to customize Install Doctor, check out our [Customization](https://install.doctor/docs/customization) # For a full list of variables you can use to customize Install Doctor, check out our [Customization](https://install.doctor/docs/customization)
# and [Secrets](https://install.doctor/docs/customization/secrets) documentation. # and [Secrets](https://install.doctor/docs/customization/secrets) documentation.
@ -55,19 +55,22 @@
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
# @description Detect `START_REPO` format and determine appropriate git address, otherwise use the master Install Doctor branch # @description Detect `START_REPO` format and determine appropriate git address, otherwise use the master Install Doctor branch
if [ -z "$START_REPO" ]; then if [ -z "$START_REPO" ] && [ -z "$REPO" ]; then
START_REPO="https://gitlab.com/megabyte-labs/install.doctor.git" START_REPO="https://gitlab.com/megabyte-labs/install.doctor.git"
else else
if [[ "$START_REPO == *"/"* ]]; then if [ -n "$REPO" ] && [ -z "$START_REPO" ]; then
# Either full git address or GitHubUser/RepoName START_REPO="$REPO"
if [[ "$START_REPO" == *":"* ]] || [[ "$START_REPO" == *"//"* ]]; then fi
START_REPO="$START_REPO" if [[ "$START_REPO == *"/"* ]]; then
else # Either full git address or GitHubUser/RepoName
START_REPO="https://github.com/${START_REPO}.git" if [[ "$START_REPO" == *":"* ]] || [[ "$START_REPO" == *"//"* ]]; then
fi START_REPO="$START_REPO"
else else
START_REPO="https://github.com/$START_REPO/install.doctor.git" START_REPO="https://github.com/${START_REPO}.git"
fi fi
else
START_REPO="https://github.com/$START_REPO/install.doctor.git"
fi
fi fi
{{ include "partials" "logg" }} {{ include "partials" "logg" }}
@ -232,10 +235,12 @@ if [ ! -f "${XDG_CONFIG_HOME:-$HOME/.config}/chezmoi/chezmoi.yaml" ]; then
chezmoi init chezmoi init
fi fi
# @description Run `chezmoi apply` and enable verbose mode if the `DEBUG_MODE` environment variable is set to true # @description Run `chezmoi apply` and enable verbose mode if the `DEBUG_MODE` or `DEBUG` environment variable is set to true
logg info 'Running `chezmoi apply`' logg info 'Running `chezmoi apply`'
if [ "$DEBUG_MODE" = 'true' ]; then if [ "$DEBUG_MODE" = 'true' ]; then
DEBUG_MODIFIER="-vvvvv" DEBUG_MODIFIER="-vvvvv"
elif [ "$DEBUG" = 'true' ]; then
DEBUG_MODIFIER="-vvvvv"
fi fi
# @description Save the log of the provision process to `${XDG_DATA_HOME:-$HOME/.local/share}/install.doctor.$(date +%s).log` and add the Chezmoi # @description Save the log of the provision process to `${XDG_DATA_HOME:-$HOME/.local/share}/install.doctor.$(date +%s).log` and add the Chezmoi