|
|
|
|
@ -974,22 +974,27 @@ pipeline {
|
|
|
|
|
if exist target\SLMS-v1.0.0.zip copy /Y target\SLMS-v1.0.0.zip artifacts\SLMS-v1.0.0.zip >nul
|
|
|
|
|
|
|
|
|
|
REM 创建 release 临时目录
|
|
|
|
|
if exist "%RELEASE_DIR%" rmdir /S /Q "%RELEASE_DIR%"
|
|
|
|
|
if exist "%RELEASE_DIR%" rmdir /S /Q "%RELEASE_DIR%" 2>nul
|
|
|
|
|
mkdir "%RELEASE_DIR%"
|
|
|
|
|
xcopy /E /I /Y artifacts "%RELEASE_DIR%\artifacts" >nul
|
|
|
|
|
|
|
|
|
|
pushd "%RELEASE_DIR%"
|
|
|
|
|
git init >nul
|
|
|
|
|
git checkout -b release >nul
|
|
|
|
|
REM 进入临时目录
|
|
|
|
|
cd /d "%RELEASE_DIR%"
|
|
|
|
|
|
|
|
|
|
REM 初始化仓库
|
|
|
|
|
git init
|
|
|
|
|
git checkout -b release
|
|
|
|
|
git config user.name "Jenkins CI"
|
|
|
|
|
git config user.email "ldl@chzu.edu.cn"
|
|
|
|
|
git add .
|
|
|
|
|
git commit -m "release: 构建制品 Build #%BUILD_NUMBER%" >nul
|
|
|
|
|
git commit -m "release: 构建制品 Build #%BUILD_NUMBER%"
|
|
|
|
|
git remote add origin https://%USER_ENC%:%PASS_ENC%@bdgit.educoder.net/pu6zrsfoy/slms.git
|
|
|
|
|
echo 推送制品到头歌 release 分支...
|
|
|
|
|
git push --force origin release
|
|
|
|
|
popd
|
|
|
|
|
rmdir /S /Q "%RELEASE_DIR%" 2>nul
|
|
|
|
|
|
|
|
|
|
REM 切回工作目录并清理
|
|
|
|
|
cd /d "%WORKSPACE%"
|
|
|
|
|
if exist "%RELEASE_DIR%" rmdir /S /Q "%RELEASE_DIR%" 2>nul
|
|
|
|
|
echo ✓ release 分支已更新制品
|
|
|
|
|
'''
|
|
|
|
|
}
|
|
|
|
|
|