forked from masalachai/deploy-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
27 lines (20 loc) · 656 Bytes
/
deploy.sh
File metadata and controls
27 lines (20 loc) · 656 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
set -e
SCRIPT_PATH=$(dirname $(readlink -f $0))
cd $SCRIPT_PATH
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
. $SCRIPT_PATH/scripts/util.sh
. $SCRIPT_PATH/scripts/defaults.sh
if [ "$DS_UPDATE" = "true" ]; then
title "deploy-scripts $(cat $SCRIPT_PATH/.VERSION) - update"
git config pull.rebase false
git pull origin $CURRENT_BRANCH | indent
fi
if [ "$PROJECT_DEPLOY_DIR" = "" ]; then
error "No project directory specified through PROJECT_DEPLOY_DIR variable"
fi
if [ "$1" = "" ]; then
error "No deployment enviroment supplied"
fi
cd $PROJECT_DEPLOY_DIR
PROJECT_DEPLOY_DIR=$PROJECT_DEPLOY_DIR sh $SCRIPT_PATH/scripts/deploy.sh $1