C#代码
- #ifconfig
- echo $projectPath
- echo $developer
- echo $rebuildBranch
- ### 获取最后一层的项目名称
- las_dir=$(basename "$projectPath")
- ### 提取上一层目录的全路径
- cur_dir=$(dirname $projectPath)
- ### 获取业务线的名称第二层
- pat_dir=$(basename "$cur_dir")
- echo $las_dir
- echo $cur_dir
- echo $pat_dir
- ### 通用前端发布脚本( 从本地同步来取 dist.tar.gz 文件包 ) ###
- wwwroot=/data/apps/nginx/htdocs/public/frontend$projectPath &&
- cd $wwwroot && pwd && git fetch && git checkout dev-$developer &&
- git pull origin dev-$developer &&
- bash /sh/downdist.sh /data/apps/nginx/htdocs/public/frontend$projectPath/upload/dynamicAssets.json /data/apps/nginx/htdocs/public/tarfile/XXX/$developer$projectPath http://dl.ktm1234.com/XXX/$developer$projectPath
- ### 通用前端发布脚本( 从本地同步来取 dist.tar.gz 文件包 ) ###
- wwwroot=/data/apps/nginx/htdocs/public/frontend$projectPath &&
- cd $wwwroot && pwd
- if [[ $rebuildBranch == true ]] ;then
- echo '---- 全新构建分支 ------'
- git checkout . && git checkout master &&
- git branch -D dev-$developer && git fetch &&
- git checkout -b dev-$developer origin/dev-$developer &&
- bash /sh/downdist.sh /data/apps/nginx/htdocs/public/frontend$projectPath/upload/dynamicAssets.json /data/apps/nginx/htdocs/public/tarfile/XXX/$developer$projectPath http://dl.ktm1234.com/XXX/$developer$projectPath
- else
- echo '---- 更新新版本 ------'
- git fetch && git checkout dev-$developer &&
- git checkout . && git pull origin dev-$developer &&
- bash /sh/downdist.sh /data/apps/nginx/htdocs/public/frontend$projectPath/upload/dynamicAssets.json /data/apps/nginx/htdocs/public/tarfile/XXX/$developer$projectPath http://dl.ktm1234.com/XXX/$developer$projectPath
- fi