added ability to one-time override the variables
by setting the variables externally at runtime when invoking the utility
This commit is contained in:
parent
ce7e2593f4
commit
28705cabe3
@ -1,19 +1,25 @@
|
||||
#/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# Check if the source server variable has already been set externally
|
||||
if [ -z "${DEPLOY_SOURCE}" ]; then
|
||||
# Check for the source server (with default)
|
||||
DEPLOY_SOURCE_FILE="${HOME}/.deploy_source"
|
||||
DEPLOY_SOURCE="https://git.bjphoster.com/deployments"
|
||||
if [ -f "${DEPLOY_SOURCE_FILE}" ]; then
|
||||
. "${DEPLOY_SOURCE_FILE}"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check if the deploy position variable has already been set externally
|
||||
if [ -z "${DEPLOY_DESTINATION}" ]; then
|
||||
# Check for the deploy position (with default)
|
||||
DEPLOY_DESTINATION_FILE="${HOME}/.deploy_destination"
|
||||
DEPLOY_DESTINATION="/opt"
|
||||
if [ -f "${DEPLOY_DESTINATION_FILE}" ]; then
|
||||
. "${DEPLOY_DESTINATION_FILE}"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check if the correct usage is respected
|
||||
if [ $# -lt 2 ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user