diff --git a/scripts/.rsyncenv b/scripts/.rsyncenv new file mode 100644 index 0000000000..41028a0157 --- /dev/null +++ b/scripts/.rsyncenv @@ -0,0 +1 @@ +REMOTE_DIR=chenshuoheng@192.168.2.100:/app/halo/ \ No newline at end of file diff --git a/scripts/.rsyncignore b/scripts/.rsyncignore new file mode 100644 index 0000000000..730f14f3e9 --- /dev/null +++ b/scripts/.rsyncignore @@ -0,0 +1,2 @@ +# git ignore style +.DS_Store \ No newline at end of file diff --git a/scripts/rsync_backup.sh b/scripts/rsync_backup.sh new file mode 100755 index 0000000000..3b859a5ca0 --- /dev/null +++ b/scripts/rsync_backup.sh @@ -0,0 +1,21 @@ +#!/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 "syning ${APP_RELEASE_ALL} to ${REMOTE_DIR}" +# 根目录是脚本文件所在的上一级 +rsync --exclude-from=${CWD}/.rsyncignore -e 'ssh -p 32200' -rctvO ${APP_RELEASE_ALL} ${REMOTE_DIR} \ No newline at end of file diff --git a/scripts/rsync_retrieve.sh b/scripts/rsync_retrieve.sh new file mode 100755 index 0000000000..f607f05f14 --- /dev/null +++ b/scripts/rsync_retrieve.sh @@ -0,0 +1,21 @@ +#!/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=`grep -r REMOTE_DIR ${CWD}/.rsyncenv | awk -F '=' '{print $2}'` + +echo "retrieving from ${REMOTE} to ${APP_RELEASE_ALL}" +# 根目录是脚本文件所在的上一级 +rsync --exclude-from=${CWD}/.rsyncignore -rctvOe 'ssh -p 32200' ${REMOTE} ${APP_RELEASE_ALL} \ No newline at end of file diff --git a/scripts/tinker_env.sh b/scripts/tinker_env.sh index 2a7400bf4d..9188e69268 100755 --- a/scripts/tinker_env.sh +++ b/scripts/tinker_env.sh @@ -20,7 +20,8 @@ GRADLE_FILE=${PROJECT_BASE}/gradle.properties VERSION_NAME=`grep -r versionName ${PROJECT_BASE}/dependencies.gradle | awk -F '\"' '{print $2}'` VERSION_CODE=`grep -r versionCode ${PROJECT_BASE}/dependencies.gradle | awk '{print $4}'` -APP_RELEASE_BASE=${PROJECT_BASE}/release-app/${VERSION_NAME}_${VERSION_CODE} +APP_RELEASE_ALL=${PROJECT_BASE}/release-app/ +APP_RELEASE_BASE=${APP_RELEASE_ALL}/${VERSION_NAME}_${VERSION_CODE} # apk应该以tinker打基准包的那个apk为准,找出文件名包含flavor publish 的apk #APP_RELEASE_FILE=${PROJECT_BASE}/release-app/${versionName}_${versionCode}/patch/app-xxxxxx-gitsha/app-publish-release.apk