提交 201e82fd 编写于 作者: Y Yiqing Liu 提交者: GitHub

Revert "[TD-11752]<CI>different branches use different dir (#8909)"

This reverts commit 520c3216.
上级 52516028
......@@ -41,54 +41,68 @@ def pre_test(){
killall -9 taosd ||echo "no taosd running"
killall -9 gdb || echo "no gdb running"
killall -9 python3.8 || echo "no python program running"
cd ${WS}
rm -rf ${WK}
cd ${WKC}
git reset --hard HEAD~10 >/dev/null
'''
script {
if (env.CHANGE_TARGET == 'master') {
sh '''
cd ${WS}
cd TDinternal_master
git pull
cd community
git pull
cd ${WS}
cp -fr TDinternal_master TDinternal
cd ${WKC}
git checkout master
'''
}
else if(env.CHANGE_TARGET == '2.0'){
sh '''
cd ${WS}
cd TDinternal_2.0
git pull
cd community
git pull
cd ${WS}
cp -fr TDinternal_2.0 TDinternal
cd ${WKC}
git checkout 2.0
'''
}
else{
sh '''
cd ${WS}
cd TDinternal_develop
git pull
cd community
git pull
cd ${WS}
cp -fr TDinternal_develop TDinternal
cd ${WKC}
git checkout develop
'''
}
}
sh'''
cd ${WKC}
[ -f src/connector/grafanaplugin/README.md ] && rm -f src/connector/grafanaplugin/README.md > /dev/null || echo "failed to remove grafanaplugin README.md"
git pull >/dev/null
git fetch origin +refs/pull/${CHANGE_ID}/merge
git checkout -qf FETCH_HEAD
git clean -dfx
git ls-files --stage | grep 160000 | awk '{print $4}' | xargs git rm --cached
git submodule update --init --recursive
cd ${WK}
git reset --hard HEAD~10
'''
script {
if (env.CHANGE_TARGET == 'master') {
sh '''
cd ${WK}
git checkout master
'''
}
else if(env.CHANGE_TARGET == '2.0'){
sh '''
cd ${WK}
git checkout 2.0
'''
}
else{
sh '''
cd ${WK}
git checkout develop
'''
}
}
sh '''
cd ${WK}
cd ${WK}
git pull >/dev/null
export TZ=Asia/Harbin
date
git clean -dfx
mkdir debug
cd debug
cmake .. > /dev/null
......@@ -102,112 +116,140 @@ def pre_test(){
def pre_test_noinstall(){
sh'hostname'
sh'''
cd ${WS}
rm -rf ${WK}
cd ${WKC}
git reset --hard HEAD~10 >/dev/null
'''
script {
if (env.CHANGE_TARGET == 'master') {
sh '''
cd ${WS}
cd TDinternal_master
git pull
cd community
git pull
cd ${WS}
cp -fr TDinternal_master TDinternal
cd ${WKC}
git checkout master
'''
}
else if(env.CHANGE_TARGET == '2.0'){
sh '''
cd ${WS}
cd TDinternal_20
git pull
cd community
git pull
cd ${WS}
cp -fr TDinternal_20 TDinternal
cd ${WKC}
git checkout 2.0
'''
}
else{
sh '''
cd ${WS}
cd TDinternal_develop
git pull
cd community
git pull
cd ${WS}
cp -fr TDinternal_develop TDinternal
cd ${WKC}
git checkout develop
'''
}
}
sh'''
cd ${WKC}
[ -f src/connector/grafanaplugin/README.md ] && rm -f src/connector/grafanaplugin/README.md > /dev/null || echo "failed to remove grafanaplugin README.md"
git pull >/dev/null
git fetch origin +refs/pull/${CHANGE_ID}/merge
git checkout -qf FETCH_HEAD
git clean -dfx
git ls-files --stage | grep 160000 | awk '{print $4}' | xargs git rm --cached
git submodule update --init --recursive
cd ${WK}
git reset --hard HEAD~10
'''
script {
if (env.CHANGE_TARGET == 'master') {
sh '''
cd ${WK}
git checkout master
'''
}
else if(env.CHANGE_TARGET == '2.0'){
sh '''
cd ${WK}
git checkout 2.0
'''
}
else{
sh '''
cd ${WK}
git checkout develop
'''
}
}
sh '''
cd ${WK}
cd ${WK}
git pull >/dev/null
export TZ=Asia/Harbin
date
git clean -dfx
mkdir debug
cd debug
cmake .. > /dev/null
make
make
'''
return 1
}
def pre_test_mac(){
sh'hostname'
sh'''
cd ${WS}
rm -rf ${WK}
cd ${WKC}
git reset --hard HEAD~10 >/dev/null
'''
script {
if (env.CHANGE_TARGET == 'master') {
sh '''
cd ${WS}
cd TDinternal_master
git pull
cd community
git pull
cd ${WS}
cp -fr TDinternal_master TDinternal
cd ${WKC}
git checkout master
'''
}
else if(env.CHANGE_TARGET == '2.0'){
sh '''
cd ${WS}
cd TDinternal_20
git pull
cd community
git pull
cd ${WS}
cp -fr TDinternal_20 TDinternal
cd ${WKC}
git checkout 2.0
'''
}
else{
sh '''
cd ${WS}
cd TDinternal_develop
git pull
cd community
git pull
cd ${WS}
cp -fr TDinternal_develop TDinternal
cd ${WKC}
git checkout develop
'''
}
}
sh'''
cd ${WKC}
[ -f src/connector/grafanaplugin/README.md ] && rm -f src/connector/grafanaplugin/README.md > /dev/null || echo "failed to remove grafanaplugin README.md"
git pull >/dev/null
git fetch origin +refs/pull/${CHANGE_ID}/merge
git checkout -qf FETCH_HEAD
git clean -dfx
git ls-files --stage | grep 160000 | awk '{print $4}' | xargs git rm --cached
git submodule update --init --recursive
cd ${WK}
git reset --hard HEAD~10
'''
script {
if (env.CHANGE_TARGET == 'master') {
sh '''
cd ${WK}
git checkout master
'''
}
else if(env.CHANGE_TARGET == '2.0'){
sh '''
cd ${WK}
git checkout 2.0
'''
}
else{
sh '''
cd ${WK}
git checkout develop
'''
}
}
sh '''
cd ${WK}
cd ${WK}
git pull >/dev/null
export TZ=Asia/Harbin
date
git clean -dfx
mkdir debug
cd debug
cmake .. > /dev/null
......@@ -222,47 +264,67 @@ def pre_test_win(){
taskkill /f /t /im python.exe
cd C:\\
rd /s /Q C:\\TDengine
cd C:\\workspace
rd /s /Q C:\\workspace\\TDinternal | echo 1
cd C:\\workspace\\TDinternal
rd /s /Q C:\\workspace\\TDinternal\\debug
cd C:\\workspace\\TDinternal\\community
git reset --hard HEAD~10
'''
script {
if (env.CHANGE_TARGET == 'master') {
bat '''
cd C:\\workspace\\TDinternal_master
git pull
cd C:\\workspace\\TDinternal_master\\community
git pull
xcopy /e/y/i/f C:\\workspace\\TDinternal_master C:\\workspace\\TDinternal
cd C:\\workspace\\TDinternal\\community
git checkout master
'''
}
else if(env.CHANGE_TARGET == '2.0'){
bat '''
cd C:\\workspace\\TDinternal_20
git pull
cd C:\\workspace\\TDinternal_20\\community
git pull
xcopy /e/y/i/f C:\\workspace\\TDinternal_20 C:\\workspace\\TDinternal
cd C:\\workspace\\TDinternal\\community
git checkout 2.0
'''
}
else{
bat '''
cd C:\\workspace\\TDinternal_develop
git pull
cd C:\\workspace\\TDinternal_develop\\community
git pull
xcopy /e/y/i/f C:\\workspace\\TDinternal_develop C:\\workspace\\TDinternal
cd C:\\workspace\\TDinternal\\community
git checkout develop
'''
}
}
bat'''
cd C:\\workspace\\TDinternal\\community
git pull
git fetch origin +refs/pull/%CHANGE_ID%/merge
git checkout -qf FETCH_HEAD
git clean -dfx
git submodule update --init --recursive
cd C:\\workspace\\TDinternal
git reset --hard HEAD~10
'''
script {
if (env.CHANGE_TARGET == 'master') {
bat '''
cd C:\\workspace\\TDinternal
git checkout master
'''
}
else if(env.CHANGE_TARGET == '2.0'){
bat '''
cd C:\\workspace\\TDinternal
git checkout 2.0
'''
}
else{
bat '''
cd C:\\workspace\\TDinternal
git checkout develop
'''
}
}
bat '''
cd C:\\workspace\\TDinternal
git pull
date
git clean -dfx
mkdir debug
cd debug
call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat" amd64
......@@ -282,7 +344,6 @@ pipeline {
environment{
WK = '/var/lib/jenkins/workspace/TDinternal'
WKC= '/var/lib/jenkins/workspace/TDinternal/community'
WS = '/var/lib/jenkins/workspace'
}
stages {
stage('pre_build'){
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册