From 82b70abfd90ccc18db7a210fc90b56095e506e1e Mon Sep 17 00:00:00 2001 From: Kalirajan Ganesan <87634016+kalirajanganeshan@users.noreply.github.com> Date: Tue, 27 Feb 2024 15:19:49 +0530 Subject: [PATCH 1/4] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 26147a7..36061db 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,4 +1,4 @@ -node('content') +node('content1') { timestamps { From 21c3d40037ede55fd2809a7dfa0c5439caddce1e Mon Sep 17 00:00:00 2001 From: SyncfusionBuild <89958145+SyncfusionBuild@users.noreply.github.com> Date: Tue, 27 Feb 2024 15:24:10 +0530 Subject: [PATCH 2/4] Updated Jenkinsfile --- Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 36061db..d7b4c2e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -82,3 +82,5 @@ if(currentBuild.result != 'FAILURE') step([$class: 'WsCleanup']) } } } + +// Updated Jenkinsfile content \ No newline at end of file From 03fc7762e57cbc1df09d88041dde492d0fece77e Mon Sep 17 00:00:00 2001 From: Kalirajan Ganesan <87634016+kalirajanganeshan@users.noreply.github.com> Date: Tue, 27 Feb 2024 15:25:12 +0530 Subject: [PATCH 3/4] Update Jenkinsfile --- Jenkinsfile | 168 ++++++++++++++++++++++++++-------------------------- 1 file changed, 83 insertions(+), 85 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d7b4c2e..c981431 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,86 +1,84 @@ -node('content1') -{ - timestamps - { - timeout(time: 7200000, unit: 'MILLISECONDS') { -String platform='angular-api'; - try - { - - def Content=""; - env.PATH = "${ProgramFiles}"+"\\Git\\mingw64\\bin;${env.PATH}" - - //Clone scm repository in Workspace source directory - stage ('Checkout') - { - dir('Spell-Checker') - { - checkout scm - - def branchCommit = '"' + 'https://api.github.com/repos/syncfusion-content/angular-api-docs/pulls/' + env.pullRequestId + '/files' - String branchCommitDetails = bat returnStdout: true, script: 'curl -H "Accept: application/vnd.github.v3+json" -u SyncfusionBuild:' + env.GithubBuildAutomation_PrivateToken + " " + branchCommit - def ChangeFiles= branchCommitDetails.split('"filename": '); - for (int i= 1; i < ChangeFiles.size();i++) - { - def ChangeFile= ChangeFiles[i].split(',')[0].replace('"', '') - Content += env.WORKSPACE + "\\Spell-Checker\\" + ChangeFile + "\r\n"; - } - - if (Content) { - writeFile file: env.WORKSPACE+"/cireports/content.txt", text: Content - } - else { - writeFile file: env.WORKSPACE+"/cireports/content.txt", text: "There are no filepaths found for this commit." - } - - } - - //Checkout the ug_spellchecker from development Source - checkout([$class: 'GitSCM', branches: [[name: '*/development']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'ug_spellchecker']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: env.githubCredentialId, url: 'https://github.com/syncfusion-content/ug_spellchecker.git']]]) - - } - - } - - catch(Exception e) - { - currentBuild.result = 'FAILURE' - } -if(currentBuild.result != 'FAILURE') -{ - stage 'Build Source' - try - { - gitlabCommitStatus("Build") - { - bat 'powershell.exe -ExecutionPolicy ByPass -File '+env.WORKSPACE+"/ug_spellchecker/build.ps1 -Script "+env.WORKSPACE+"/ug_spellchecker/build.cake -Target build -Platform \""+platform+"\" -Targetbranch "+env.githubTargetBranch+" -Branch "+'"'+env.githubSourceBranch+'"' - } - - def files = findFiles(glob: '**/cireports/errorlogs/*.txt') - - if(files.size() > 0) - { - currentBuild.result = 'FAILURE' - } - - } - catch(Exception e) - { - currentBuild.result = 'FAILURE' - } -} - - stage 'Delete Workspace' - - def files = findFiles(glob: '**/cireports/spellcheck/*.*') - def files = findFiles(glob: '**/cireports/*.*') - - if(files.size() > 0) - { - archiveArtifacts artifacts: 'cireports/', excludes: null - } - step([$class: 'WsCleanup']) } - } -} +node('content1') +{ + timestamps + { + timeout(time: 7200000, unit: 'MILLISECONDS') { +String platform='angular-api'; + try + { + + def Content=""; + env.PATH = "${ProgramFiles}"+"\\Git\\mingw64\\bin;${env.PATH}" + + //Clone scm repository in Workspace source directory + stage ('Checkout') + { + dir('Spell-Checker') + { + checkout scm + + def branchCommit = '"' + 'https://api.github.com/repos/syncfusion-content/angular-api-docs/pulls/' + env.pullRequestId + '/files' + String branchCommitDetails = bat returnStdout: true, script: 'curl -H "Accept: application/vnd.github.v3+json" -u SyncfusionBuild:' + env.GithubBuildAutomation_PrivateToken + " " + branchCommit + def ChangeFiles= branchCommitDetails.split('"filename": '); + for (int i= 1; i < ChangeFiles.size();i++) + { + def ChangeFile= ChangeFiles[i].split(',')[0].replace('"', '') + Content += env.WORKSPACE + "\\Spell-Checker\\" + ChangeFile + "\r\n"; + } + + if (Content) { + writeFile file: env.WORKSPACE+"/cireports/content.txt", text: Content + } + else { + writeFile file: env.WORKSPACE+"/cireports/content.txt", text: "There are no filepaths found for this commit." + } + + } + + //Checkout the ug_spellchecker from development Source + checkout([$class: 'GitSCM', branches: [[name: '*/development']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'ug_spellchecker']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: env.githubCredentialId, url: 'https://github.com/syncfusion-content/ug_spellchecker.git']]]) + + } + + } + + catch(Exception e) + { + currentBuild.result = 'FAILURE' + } +if(currentBuild.result != 'FAILURE') +{ + stage 'Build Source' + try + { + gitlabCommitStatus("Build") + { + bat 'powershell.exe -ExecutionPolicy ByPass -File '+env.WORKSPACE+"/ug_spellchecker/build.ps1 -Script "+env.WORKSPACE+"/ug_spellchecker/build.cake -Target build -Platform \""+platform+"\" -Targetbranch "+env.githubTargetBranch+" -Branch "+'"'+env.githubSourceBranch+'"' + } + + def files = findFiles(glob: '**/cireports/errorlogs/*.txt') + + if(files.size() > 0) + { + currentBuild.result = 'FAILURE' + } + + } + catch(Exception e) + { + currentBuild.result = 'FAILURE' + } +} -// Updated Jenkinsfile content \ No newline at end of file + stage 'Delete Workspace' + + def files = findFiles(glob: '**/cireports/spellcheck/*.*') + def files = findFiles(glob: '**/cireports/*.*') + + if(files.size() > 0) + { + archiveArtifacts artifacts: 'cireports/', excludes: null + } + step([$class: 'WsCleanup']) } + } +} From 0926258f3da2b742a247ac4f9874400e1669ccfa Mon Sep 17 00:00:00 2001 From: SyncfusionBuild <89958145+SyncfusionBuild@users.noreply.github.com> Date: Tue, 27 Feb 2024 15:35:07 +0530 Subject: [PATCH 4/4] Updated Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c981431..6912393 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,7 +17,7 @@ String platform='angular-api'; { checkout scm - def branchCommit = '"' + 'https://api.github.com/repos/syncfusion-content/angular-api-docs/pulls/' + env.pullRequestId + '/files' + def branchCommit = 'https://api.github.com/repos/syncfusion-content/'+env.githubSourceRepoHttpUrl.split('/')[env.githubSourceRepoHttpUrl.split('/').size() - 1]+'/pulls/' + env.pullRequestId + '/files' String branchCommitDetails = bat returnStdout: true, script: 'curl -H "Accept: application/vnd.github.v3+json" -u SyncfusionBuild:' + env.GithubBuildAutomation_PrivateToken + " " + branchCommit def ChangeFiles= branchCommitDetails.split('"filename": '); for (int i= 1; i < ChangeFiles.size();i++)