Skip to content
This repository was archived by the owner on Nov 15, 2018. It is now read-only.

Commit 9c88db0

Browse files
author
Andy Goldstein
committed
Added script to run in sync_gears.sh after rsync is done to flip a new gear to use binary deployments if they exist on the head gear
1 parent 88d4bed commit 9c88db0

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

support/deploy_tool_sync.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash -e
2+
3+
for f in ~/.env/*; do
4+
. $f
5+
done
6+
7+
if [ ! -d $OPENSHIFT_HOMEDIR/app-root/runtime/user/deployments ]; then
8+
# clean exit if deployments dir doesn't exist
9+
exit 0
10+
fi
11+
12+
deployment=`ls $OPENSHIFT_HOMEDIR/app-root/runtime/user/deployments | sort | tail -1`
13+
14+
# remove the trailing /
15+
REPO_DIR=${OPENSHIFT_REPO_DIR%?}
16+
17+
# if repo is not a symlink and we have at least 1 deployment, set up the symlink
18+
if [ ! -L $REPO_DIR ] && [ -n $deployment ]; then
19+
mv $REPO_DIR $OPENSHIFT_HOMEDIR/app-root/runtime/repo.orig
20+
ln -s $OPENSHIFT_HOMEDIR/app-root/runtime/user/deployments/$deployment/repo $REPO_DIR
21+
fi

0 commit comments

Comments
 (0)