#!/usr/bin/env bash
# *****************************************************************************
# @author CsHeng
# @2017.9.14 init
#
# 简单禁用tinker标志位
#
#
# *****************************************************************************

# get current shell absolute dir
CWD=$(cd "$(dirname "$0")"; pwd)

source ${CWD}/tinker_env.sh

# sample .rsyncenv file content: REMOTE_DIR=chenshuoheng@192.168.2.100:/app/halo/
REMOTE_DIR=`grep -r REMOTE_DIR ${CWD}/.rsyncenv | awk -F '=' '{print $2}'`

echo "syncing ${APP_RELEASE_ALL} to ${REMOTE_DIR}"
# 根目录是脚本文件所在的上一级
rsync --exclude-from=${CWD}/.rsyncignore -e 'ssh -p 32200' -rctvO ${APP_RELEASE_ALL} ${REMOTE_DIR}