added optional branch/tag checkout feature
This commit is contained in:
parent
ea0bea3c94
commit
0d7266ce35
10
deploy.sh
10
deploy.sh
@ -16,8 +16,8 @@ if [ -f "${DEPLOY_DESTINATION_FILE}" ]; then
|
||||
fi
|
||||
|
||||
# Check if the correct usage is respected
|
||||
if [ $# -ne 2 ]; then
|
||||
echo "Usage: $0 <service> <service name>"
|
||||
if [ $# -le 2 ]; then
|
||||
echo "Usage: $0 <service> <service name> [branch/tag]"
|
||||
echo
|
||||
echo "Current settings:"
|
||||
echo "- Source · ${DEPLOY_SOURCE}"
|
||||
@ -27,3 +27,9 @@ fi
|
||||
|
||||
echo "deploying ..."
|
||||
git clone "${DEPLOY_SOURCE}/${1}" "${DEPLOY_DESTINATION}/${2}"
|
||||
|
||||
if [ $# -eq 3 ]; then
|
||||
pushd "${DEPLOY_DESTINATION}/${2}"
|
||||
git checkout "${3}"
|
||||
popd
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user