Compare commits
2 Commits
ce7e2593f4
...
512b9c9c91
Author | SHA1 | Date | |
---|---|---|---|
512b9c9c91 | |||
28705cabe3 |
30
deploy.sh
30
deploy.sh
@ -1,18 +1,24 @@
|
|||||||
#/usr/bin/env bash
|
#/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Check for the source server (with default)
|
# Check if the source server variable has already been set externally
|
||||||
DEPLOY_SOURCE_FILE="${HOME}/.deploy_source"
|
if [ -z "${DEPLOY_SOURCE}" ]; then
|
||||||
DEPLOY_SOURCE="https://git.bjphoster.com/deployments"
|
# Check for the source server (with default)
|
||||||
if [ -f "${DEPLOY_SOURCE_FILE}" ]; then
|
DEPLOY_SOURCE_FILE="${HOME}/.deploy_source"
|
||||||
. "${DEPLOY_SOURCE_FILE}"
|
DEPLOY_SOURCE="https://git.bjphoster.com/deployments"
|
||||||
|
if [ -f "${DEPLOY_SOURCE_FILE}" ]; then
|
||||||
|
. "${DEPLOY_SOURCE_FILE}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for the deploy position (with default)
|
# Check if the deploy position variable has already been set externally
|
||||||
DEPLOY_DESTINATION_FILE="${HOME}/.deploy_destination"
|
if [ -z "${DEPLOY_DESTINATION}" ]; then
|
||||||
DEPLOY_DESTINATION="/opt"
|
# Check for the deploy position (with default)
|
||||||
if [ -f "${DEPLOY_DESTINATION_FILE}" ]; then
|
DEPLOY_DESTINATION_FILE="${HOME}/.deploy_destination"
|
||||||
. "${DEPLOY_DESTINATION_FILE}"
|
DEPLOY_DESTINATION="/opt"
|
||||||
|
if [ -f "${DEPLOY_DESTINATION_FILE}" ]; then
|
||||||
|
. "${DEPLOY_DESTINATION_FILE}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if the correct usage is respected
|
# Check if the correct usage is respected
|
||||||
@ -20,8 +26,8 @@ if [ $# -lt 2 ]; then
|
|||||||
echo "Usage: $0 <service> <service name> [branch/tag]"
|
echo "Usage: $0 <service> <service name> [branch/tag]"
|
||||||
echo
|
echo
|
||||||
echo "Current settings:"
|
echo "Current settings:"
|
||||||
echo "- Source · ${DEPLOY_SOURCE}"
|
echo "- \$DEPLOY_SOURCE · ${DEPLOY_SOURCE}"
|
||||||
echo "- Destination · ${DEPLOY_DESTINATION}"
|
echo "- \$DEPLOY_DESTINATION · ${DEPLOY_DESTINATION}"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user