@@ -10,14 +10,8 @@ it is need as field to store the results of the tests.
1010*/
1111@Field def pythonTasksGen
1212
13- /**
14- This is the git commit sha which it's required to be used in different stages.
15- It does store the env GIT_SHA
16- */
17- @Field def gitCommit
18-
1913pipeline {
20- agent none
14+ agent any
2115 environment {
2216 REPO = ' apm-agent-python'
2317 BASE_DIR = " src/github.com/elastic/${ env.REPO} "
@@ -62,9 +56,6 @@ pipeline {
6256 deleteDir()
6357 gitCheckout(basedir : " ${ BASE_DIR} " , githubNotifyFirstTimeContributor : true )
6458 stash allowEmpty : true , name : ' source' , useDefaultExcludes : false
65- script {
66- gitCommit = env. GIT_SHA
67- }
6859 }
6960 }
7061 stage(' Sanity checks' ) {
@@ -83,7 +74,7 @@ pipeline {
8374 docker. image(' python:3.7-stretch' ). inside(" -e PATH=${ PATH} :${ env.WORKSPACE} /bin" ){
8475 dir(" ${ BASE_DIR} " ){
8576 // registry: '' will help to disable the docker login
86- preCommit(commit : " ${ gitCommit } " , junit : true , registry : ' ' )
77+ preCommit(commit : " ${ GIT_BASE_COMMIT } " , junit : true , registry : ' ' )
8778 }
8879 }
8980 }
@@ -156,10 +147,10 @@ pipeline {
156147 log(level : ' INFO' , text : ' Launching Async ITs' )
157148 build(job : env. ITS_PIPELINE , propagate : false , wait : false ,
158149 parameters : [string(name : ' AGENT_INTEGRATION_TEST' , value : ' Python' ),
159- string(name : ' BUILD_OPTS' , value : " --with-agent-python-flask --python-agent-package git+https://github.com/${ env.CHANGE_FORK?.trim() ?: 'elastic' } /${ env.REPO} .git@${ gitCommit } " ),
150+ string(name : ' BUILD_OPTS' , value : " --with-agent-python-flask --python-agent-package git+https://github.com/${ env.CHANGE_FORK?.trim() ?: 'elastic' } /${ env.REPO} .git@${ env.GIT_BASE_COMMIT } " ),
160151 string(name : ' GITHUB_CHECK_NAME' , value : env. GITHUB_CHECK_ITS_NAME ),
161152 string(name : ' GITHUB_CHECK_REPO' , value : env. REPO ),
162- string(name : ' GITHUB_CHECK_SHA1' , value : gitCommit )])
153+ string(name : ' GITHUB_CHECK_SHA1' , value : env . GIT_BASE_COMMIT )])
163154 githubNotify(context : " ${ env.GITHUB_CHECK_ITS_NAME} " , description : " ${ env.GITHUB_CHECK_ITS_NAME} ..." , status : ' PENDING' , targetUrl : " ${ env.JENKINS_URL} search/?q=${ env.ITS_PIPELINE.replaceAll('/','+')} " )
164155 }
165156 }
@@ -205,19 +196,17 @@ pipeline {
205196 }
206197 post {
207198 cleanup {
208- node(' linux && immutable' ) {
209- script{
210- if (pythonTasksGen?. results){
211- writeJSON(file : ' results.json' , json : toJSON(pythonTasksGen. results), pretty : 2 )
212- def mapResults = [" ${ params.agent_integration_test} " : pythonTasksGen. results]
213- def processor = new ResultsProcessor ()
214- processor. processResults(mapResults)
215- archiveArtifacts allowEmptyArchive : true , artifacts : ' results.json,results.html' , defaultExcludes : false
216- catchError(buildResult : ' SUCCESS' ) {
217- def datafile = readFile(file : " results.json" )
218- def json = getVaultSecret(secret : ' secret/apm-team/ci/apm-server-benchmark-cloud' )
219- sendDataToElasticsearch(es : json. data. url, data : datafile, restCall : ' /jenkins-builds-test-results/_doc/' )
220- }
199+ script{
200+ if (pythonTasksGen?. results){
201+ writeJSON(file : ' results.json' , json : toJSON(pythonTasksGen. results), pretty : 2 )
202+ def mapResults = [" ${ params.agent_integration_test} " : pythonTasksGen. results]
203+ def processor = new ResultsProcessor ()
204+ processor. processResults(mapResults)
205+ archiveArtifacts allowEmptyArchive : true , artifacts : ' results.json,results.html' , defaultExcludes : false
206+ catchError(buildResult : ' SUCCESS' ) {
207+ def datafile = readFile(file : " results.json" )
208+ def json = getVaultSecret(secret : ' secret/apm-team/ci/apm-server-benchmark-cloud' )
209+ sendDataToElasticsearch(es : json. data. url, data : datafile, restCall : ' /jenkins-builds-test-results/_doc/' )
221210 }
222211 }
223212 }
0 commit comments