From d768d251d5911b088a84562ff0ec955a9ab645a9 Mon Sep 17 00:00:00 2001 From: christopher Date: Wed, 11 Nov 2020 11:39:42 +0530 Subject: [PATCH 1/6] source updation --- .gitignore | 4 ++- Jenkinsfile | 86 ----------------------------------------------------- README.md | 2 +- 3 files changed, 4 insertions(+), 88 deletions(-) delete mode 100644 Jenkinsfile diff --git a/.gitignore b/.gitignore index 328a3b1..f01f3e7 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,6 @@ coverage/ index.js index.d.ts gulpfile.js -node_modules/ \ No newline at end of file +node_modules/ +.gitlab/ +Jenkinsfile \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 80889b2..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,86 +0,0 @@ -node('content') -{ -timestamps - { - timeout(time: 7200000, unit: 'MILLISECONDS') { -String platform='php'; - 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://gitlab.syncfusion.com/api/v4/projects/' + env.projectId + '/merge_requests/' + env.MergeRequestId + '/changes' - String branchCommitDetails = bat returnStdout: true, script: 'curl -s --request GET --header PRIVATE-TOKEN:' + env.BuildAutomation_PrivateToken + " " + branchCommit - - def ChangeFiles= branchCommitDetails.split('\n')[2]; - ChangeFiles = ChangeFiles.split('"new_path":') - - 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.gitlabCredentialId, url: 'https://gitlab.syncfusion.com/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.gitlabTargetBranch+" -Branch "+'"'+env.gitlabSourceBranch+'"' - } - - 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/*.*') - - if(files.size() > 0) - { - archiveArtifacts artifacts: 'cireports/', excludes: null - } - step([$class: 'WsCleanup']) } - } -} diff --git a/README.md b/README.md index 0224a3b..02f9028 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Documentation Guidelines +# Documentation Guidelines This section contains guidelines on naming files, sections, documents and other document elements. From 14f225c3043e6f3fb6a0936b6dee3ee3e41e86cd Mon Sep 17 00:00:00 2001 From: christopher Date: Wed, 11 Nov 2020 13:12:26 +0530 Subject: [PATCH 2/6] source updation --- Jenkinsfile | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..80889b2 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,86 @@ +node('content') +{ +timestamps + { + timeout(time: 7200000, unit: 'MILLISECONDS') { +String platform='php'; + 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://gitlab.syncfusion.com/api/v4/projects/' + env.projectId + '/merge_requests/' + env.MergeRequestId + '/changes' + String branchCommitDetails = bat returnStdout: true, script: 'curl -s --request GET --header PRIVATE-TOKEN:' + env.BuildAutomation_PrivateToken + " " + branchCommit + + def ChangeFiles= branchCommitDetails.split('\n')[2]; + ChangeFiles = ChangeFiles.split('"new_path":') + + 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.gitlabCredentialId, url: 'https://gitlab.syncfusion.com/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.gitlabTargetBranch+" -Branch "+'"'+env.gitlabSourceBranch+'"' + } + + 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/*.*') + + if(files.size() > 0) + { + archiveArtifacts artifacts: 'cireports/', excludes: null + } + step([$class: 'WsCleanup']) } + } +} From a61527533a49106e88d7bc1cf932f0e34bed4b32 Mon Sep 17 00:00:00 2001 From: christopher Date: Wed, 11 Nov 2020 18:40:40 +0530 Subject: [PATCH 3/6] source updation --- .gitignore | 4 +--- gulpfile.js | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index f01f3e7..328a3b1 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,4 @@ coverage/ index.js index.d.ts gulpfile.js -node_modules/ -.gitlab/ -Jenkinsfile \ No newline at end of file +node_modules/ \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 295a46c..b81bf22 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -31,7 +31,7 @@ gulp.task('ship-to-gitlab', function (done) { for (var changedFileName of changedFileNames.split(',')) { - if (changedFileName !== null && changedFileName !== '') { + if (changedFileName !== null && changedFileName !== '' && changedFileName !== '.gitignore') { if (fs.existsSync('../php-docs/' + changedFileName)) { // It will update the modified files From 654e75edd7ce66be113fea5f739a5e21bc7b4be4 Mon Sep 17 00:00:00 2001 From: christopher Date: Wed, 11 Nov 2020 19:15:57 +0530 Subject: [PATCH 4/6] source updation --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index b81bf22..38d6ac2 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -31,7 +31,7 @@ gulp.task('ship-to-gitlab', function (done) { for (var changedFileName of changedFileNames.split(',')) { - if (changedFileName !== null && changedFileName !== '' && changedFileName !== '.gitignore') { + if (changedFileName !== null && changedFileName !== '' && changedFileName !== '.gitignore' && !changedFileName.includes('.gitlab')) { if (fs.existsSync('../php-docs/' + changedFileName)) { // It will update the modified files From 998804861631b98507833f5fcf7938adea0b35cc Mon Sep 17 00:00:00 2001 From: christopher Date: Wed, 11 Nov 2020 19:28:25 +0530 Subject: [PATCH 5/6] source updation --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 38d6ac2..3bc82c7 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -31,7 +31,7 @@ gulp.task('ship-to-gitlab', function (done) { for (var changedFileName of changedFileNames.split(',')) { - if (changedFileName !== null && changedFileName !== '' && changedFileName !== '.gitignore' && !changedFileName.includes('.gitlab')) { + if (changedFileName !== null && changedFileName !== '' && changedFileName !== '.gitignore' && changedFileName !== 'Jenkinsfile' && !changedFileName.includes('.gitlab')) { if (fs.existsSync('../php-docs/' + changedFileName)) { // It will update the modified files From 93691755137e155ca5c3b00b1802a92064b8bd04 Mon Sep 17 00:00:00 2001 From: christopher Date: Wed, 11 Nov 2020 19:44:08 +0530 Subject: [PATCH 6/6] source updation --- Jenkinsfile | 86 ----------------------------------------------------- 1 file changed, 86 deletions(-) delete mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 80889b2..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,86 +0,0 @@ -node('content') -{ -timestamps - { - timeout(time: 7200000, unit: 'MILLISECONDS') { -String platform='php'; - 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://gitlab.syncfusion.com/api/v4/projects/' + env.projectId + '/merge_requests/' + env.MergeRequestId + '/changes' - String branchCommitDetails = bat returnStdout: true, script: 'curl -s --request GET --header PRIVATE-TOKEN:' + env.BuildAutomation_PrivateToken + " " + branchCommit - - def ChangeFiles= branchCommitDetails.split('\n')[2]; - ChangeFiles = ChangeFiles.split('"new_path":') - - 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.gitlabCredentialId, url: 'https://gitlab.syncfusion.com/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.gitlabTargetBranch+" -Branch "+'"'+env.gitlabSourceBranch+'"' - } - - 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/*.*') - - if(files.size() > 0) - { - archiveArtifacts artifacts: 'cireports/', excludes: null - } - step([$class: 'WsCleanup']) } - } -}