diff --git a/Jenkinsfile b/Jenkinsfile index ecf708037f1243f553ca3fbd79c10d58fbb0d496..9cc65d24f8aae3a97890e6676ff1091d32f7dc59 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -181,6 +181,76 @@ def pre_test_noinstall(){ ''' return 1 } +def pre_test_mac(){ + sh'hostname' + sh''' + cd ${WKC} + git reset --hard HEAD~10 >/dev/null + ''' + script { + if (env.CHANGE_TARGET == 'master') { + sh ''' + cd ${WKC} + git checkout master + ''' + } + else if(env.CHANGE_TARGET == '2.0'){ + sh ''' + cd ${WKC} + git checkout 2.0 + ''' + } + else{ + sh ''' + cd ${WKC} + git checkout develop + ''' + } + } + sh''' + cd ${WKC} + git pull >/dev/null + git fetch origin +refs/pull/${CHANGE_ID}/merge + git checkout -qf FETCH_HEAD + git clean -dfx + 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} + git pull >/dev/null + + export TZ=Asia/Harbin + date + git clean -dfx + mkdir debug + cd debug + cmake .. > /dev/null + cmake --build . + ''' + return 1 +} def pre_test_win(){ bat ''' taskkill /f /t /im python.exe @@ -581,6 +651,12 @@ pipeline { pre_test_noinstall() } } + stage('Mac_build') { + agent{label " catalina "} + steps { + pre_test_mac() + } + } stage('build'){ agent{label " wintest "}