Jenkins 配置
[root@test-4-26 bin]# cat deploy-client
#!/bin/env bash
VERSION=$1
if [ -z $2 ]; then
SUBVERSION=""
else
SUBVERSION=$2
fi
if [ -z $3 ]; then
DISTVERSION=$VERSION
else
DISTVERSION=$3
fi
SOURCE_BASE_PATH=/data/sg2/sta.sg2.kunlun.com
SOURCE_PATH=$SOURCE_BASE_PATH/${VERSION}
SHARE_SOURCE_PATH=$SOURCE_BASE_PATH/share
STATIC_PATH=/data/sg2/client-dev/fy2-others/static
VERSION_PATH=$STATIC_PATH/${DISTVERSION}
DEPLOY_PATH=$VERSION_PATH/${SUBVERSION}
SHARE_DEPLOY_PATH=$STATIC_PATH/share
cd $STATIC_PATH
svn up
cp $SHARE_SOURCE_PATH/* $SHARE_DEPLOY_PATH -ru
mkdir $DEPLOY_PATH -p
cp $SOURCE_PATH/* $DEPLOY_PATH -r
cd $STATIC_PATH
for file in `svn status|awk '$1=="?" {print $2}'`;
do
svn add -q $file;
done
svn ci -m "自动发布版本"