Skip to content

Commit f70ba88

Browse files
DHFPROD-4525: Improvements to Pipeline
Fixing windows regression Adding 9.0-12 linux regression Adding windows 9.0-12 regression Removing unnecassary code
1 parent 13448f4 commit f70ba88

File tree

1 file changed

+26
-61
lines changed

1 file changed

+26
-61
lines changed

Jenkinsfile

Lines changed: 26 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,6 @@ def dhfWinTests(String mlVersion, String type){
8585
bat 'cd data-hub & gradlew.bat ml-data-hub:test || exit /b 0'
8686
bat 'cd data-hub & gradlew.bat web:test || exit /b 0'
8787
junit '**/TEST-*.xml'
88-
commitMessage = sh (returnStdout: true, script:'''
89-
curl -u $Credentials -X GET "'''+githubAPIUrl+'''/git/commits/${GIT_COMMIT}" ''')
90-
def slurper = new JsonSlurperClassic().parseText(commitMessage.toString().trim())
91-
def commit=slurper.message.toString().trim();
92-
JIRA_ID=commit.split(("\\n"))[0].split(':')[0].trim();
93-
JIRA_ID=JIRA_ID.split(" ")[0];
94-
commitMessage=null;
9588
//jiraAddComment comment: 'Jenkins rh7_cluster_9.0-Nightly Test Results For PR Available', idOrKey: JIRA_ID, site: 'JIRA'
9689
}
9790
}
@@ -359,7 +352,7 @@ pipeline{
359352
steps{
360353
script{
361354
props = readProperties file:'data-hub/pipeline.properties';
362-
copyRPM 'Release','9.0-11'
355+
copyRPM 'Release','9.0-12'
363356
setUpML '$WORKSPACE/xdmp/src/Mark*.rpm'
364357
sh 'export JAVA_HOME=`eval echo "$JAVA_HOME_DIR"`;export GRADLE_USER_HOME=$WORKSPACE$GRADLE_DIR;export M2_HOME=$MAVEN_HOME/bin;export PATH=$GRADLE_USER_HOME:$PATH:$MAVEN_HOME/bin;cd $WORKSPACE/data-hub;rm -rf $GRADLE_USER_HOME/caches;./gradlew clean;set +e;./gradlew marklogic-data-hub:test -Dorg.gradle.jvmargs=-Xmx1g || true;sleep 10s;./gradlew ml-data-hub:test || true;sleep 10s;./gradlew web:test || true;sleep 10s;./gradlew marklogic-data-hub:testBootstrap || true;sleep 10s;./gradlew ml-data-hub:testFullCycle || true;'
365358
junit '**/TEST-*.xml'
@@ -390,53 +383,6 @@ pipeline{
390383
}
391384
}
392385
}
393-
stage('Merge PR to Integration Branch'){
394-
when {
395-
branch 'FeatureBranch'
396-
beforeAgent true
397-
}
398-
agent {label 'dhmaster'}
399-
steps{
400-
withCredentials([usernameColonPassword(credentialsId: '550650ab-ee92-4d31-a3f4-91a11d5388a3', variable: 'Credentials')]) {
401-
script{
402-
props = readProperties file:'data-hub/pipeline.properties';
403-
//JIRA_ID=env.CHANGE_TITLE.split(':')[0]
404-
prResponse = sh (returnStdout: true, script:'''
405-
curl -u $Credentials -X POST -H 'Content-Type:application/json' -d '{\"title\": \"Automated PR for Integration Branch\" , \"head\": \"FeatureBranch\" , \"base\": \"IntegrationBranch\" }' '''+githubAPIUrl+'''/pulls ''')
406-
println(prResponse)
407-
def slurper = new JsonSlurper().parseText(prResponse)
408-
println(slurper.number)
409-
prNumber=slurper.number;
410-
}
411-
}
412-
withCredentials([usernameColonPassword(credentialsId: 'a0ec09aa-f339-44de-87c4-1a4936df44f5', variable: 'Credentials')]) {
413-
sh "curl -u $Credentials -X POST -d '{\"event\": \"APPROVE\"}' "+githubAPIUrl+"/pulls/${prNumber}/reviews"
414-
}
415-
withCredentials([usernameColonPassword(credentialsId: '550650ab-ee92-4d31-a3f4-91a11d5388a3', variable: 'Credentials')]) {
416-
script{
417-
props = readProperties file:'data-hub/pipeline.properties';
418-
sh "curl -o - -s -w \"\n%{http_code}\n\" -X PUT -d '{\"commit_title\": \"$JIRA_ID: Merge pull request\", \"merge_method\": \"rebase\"}' -u $Credentials "+githubAPIUrl+"/pulls/${prNumber}/merge | tail -2 > mergeResult.txt"
419-
def mergeResult = readFile('mergeResult.txt').trim()
420-
if(mergeResult=="200"){
421-
println("Merge successful")
422-
}else{
423-
println("Merge Failed")
424-
sh 'exit 1'
425-
}
426-
}
427-
}
428-
429-
}
430-
post{
431-
success {
432-
println("Automated PR For Integration branch Completed")
433-
}
434-
failure {
435-
println("Creation of Automated PR Failed")
436-
437-
}
438-
}
439-
}
440386
stage('Linux Core Parallel Execution'){
441387
when {
442388
expression{
@@ -506,6 +452,25 @@ pipeline{
506452
}
507453
}
508454
}
455+
stage('rh7_cluster_9.0-12'){
456+
agent { label 'dhfLinuxAgent'}
457+
steps{
458+
dhflinuxTests("9.0-12","Release")
459+
}
460+
post{
461+
always{
462+
sh 'rm -rf $WORKSPACE/xdmp'
463+
}
464+
success {
465+
println("rh7_cluster_9.0-12 Tests Completed")
466+
sendMail Email,'Check the Pipeline View Here: ${JENKINS_URL}/blue/organizations/jenkins/Datahub_CI/detail/$JOB_BASE_NAME/$BUILD_ID \n\n\n Check Console Output Here: ${BUILD_URL}/console \n\n\n All the End to End tests on rh7 cluster 9.0-12 of the branch $BRANCH_NAME passed and the next stage is to merge it to release branch if all the end-end tests pass',false,'rh7_cluster_9.0-12 Tests for $BRANCH_NAME Passed'
467+
}
468+
unstable {
469+
println("rh7_cluster_9.0-12 Tests Failed")
470+
sendMail Email,'Check the Pipeline View Here: ${JENKINS_URL}/blue/organizations/jenkins/Datahub_CI/detail/$JOB_BASE_NAME/$BUILD_ID \n\n\n Check Console Output Here: ${BUILD_URL}/console \n\n\n Some of the End to End tests of the branch $BRANCH_NAME on 9.0-12 rh7 cluster failed. Please fix the tests and create a PR or create a bug for the failures.',false,'rh7_cluster_9.0-12 Tests for $BRANCH_NAME Failed'
471+
}
472+
}
473+
}
509474
stage('rh7_cluster_10.0-3'){
510475
agent { label 'dhfLinuxAgent'}
511476
steps{
@@ -827,22 +792,22 @@ pipeline{
827792
}
828793
}
829794
}
830-
stage('w12_SN_9.0-11'){
795+
stage('w12_SN_9.0-12'){
831796
agent { label 'dhfWinagent'}
832797
steps{
833-
dhfWinTests("9.0-11","Release")
798+
dhfWinTests("9.0-12","Release")
834799
}
835800
post{
836801
always{
837802
bat 'RMDIR /S/Q xdmp'
838803
}
839804
success {
840-
println("w12_SN_9.0-11 Tests Completed")
841-
sendMail Email,'Check the Pipeline View Here: ${JENKINS_URL}/blue/organizations/jenkins/Datahub_CI/detail/$JOB_BASE_NAME/$BUILD_ID \n\n\n Check Console Output Here: ${BUILD_URL}/console \n\n\n All the End to End tests on W2k12 SN 9.0-11 of the branch $BRANCH_NAME passed and the next stage is to merge it to release branch if all the end-end tests pass',false,'w12_SN_9.0-11 Tests for $BRANCH_NAME Passed'
805+
println("w12_SN_9.0-12 Tests Completed")
806+
sendMail Email,'Check the Pipeline View Here: ${JENKINS_URL}/blue/organizations/jenkins/Datahub_CI/detail/$JOB_BASE_NAME/$BUILD_ID \n\n\n Check Console Output Here: ${BUILD_URL}/console \n\n\n All the End to End tests on W2k12 SN 9.0-12 of the branch $BRANCH_NAME passed and the next stage is to merge it to release branch if all the end-end tests pass',false,'w12_SN_9.0-12 Tests for $BRANCH_NAME Passed'
842807
}
843808
unstable {
844-
println("w12_SN_9.0-11 Tests Failed")
845-
sendMail Email,'Check the Pipeline View Here: ${JENKINS_URL}/blue/organizations/jenkins/Datahub_CI/detail/$JOB_BASE_NAME/$BUILD_ID \n\n\n Check Console Output Here: ${BUILD_URL}/console \n\n\n Some of the End to End tests of the branch $BRANCH_NAME on 9.0-11 w2k12 SN failed. Please fix the tests and create a PR or create a bug for the failures.',false,'w12_SN_9.0-11 Tests for $BRANCH_NAME Failed'
809+
println("w12_SN_9.0-12 Tests Failed")
810+
sendMail Email,'Check the Pipeline View Here: ${JENKINS_URL}/blue/organizations/jenkins/Datahub_CI/detail/$JOB_BASE_NAME/$BUILD_ID \n\n\n Check Console Output Here: ${BUILD_URL}/console \n\n\n Some of the End to End tests of the branch $BRANCH_NAME on 9.0-12 w2k12 SN failed. Please fix the tests and create a PR or create a bug for the failures.',false,'w12_SN_9.0-12 Tests for $BRANCH_NAME Failed'
846811
}
847812
}
848813
}

0 commit comments

Comments
 (0)