Skip to content
This repository has been archived by the owner. It is now read-only.

Commit 14f225c

Browse files
source updation
1 parent d768d25 commit 14f225c

File tree

1 file changed

+86
-0
lines changed

1 file changed

+86
-0
lines changed

Jenkinsfile

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
node('content')
2+
{
3+
timestamps
4+
{
5+
timeout(time: 7200000, unit: 'MILLISECONDS') {
6+
String platform='php';
7+
try
8+
{
9+
10+
def Content="";
11+
env.PATH = "${ProgramFiles}"+"\\Git\\mingw64\\bin;${env.PATH}"
12+
13+
14+
//Clone scm repository in Workspace source directory
15+
stage ('Checkout')
16+
{
17+
dir('Spell-Checker')
18+
{
19+
checkout scm
20+
21+
def branchCommit = '"' + 'https://gitlab.syncfusion.com/api/v4/projects/' + env.projectId + '/merge_requests/' + env.MergeRequestId + '/changes'
22+
String branchCommitDetails = bat returnStdout: true, script: 'curl -s --request GET --header PRIVATE-TOKEN:' + env.BuildAutomation_PrivateToken + " " + branchCommit
23+
24+
def ChangeFiles= branchCommitDetails.split('\n')[2];
25+
ChangeFiles = ChangeFiles.split('"new_path":')
26+
27+
for (int i= 1; i < ChangeFiles.size();i++)
28+
{
29+
def ChangeFile= ChangeFiles[i].split(',')[0].replace('"', '')
30+
Content += env.WORKSPACE + "\\Spell-Checker\\" + ChangeFile + "\r\n";
31+
}
32+
33+
if (Content) {
34+
writeFile file: env.WORKSPACE+"/cireports/content.txt", text: Content
35+
}
36+
else {
37+
writeFile file: env.WORKSPACE+"/cireports/content.txt", text: "There are no filepaths found for this commit."
38+
}
39+
40+
}
41+
42+
//Checkout the ug_spellchecker from development Source
43+
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']]])
44+
45+
}
46+
}
47+
48+
catch(Exception e)
49+
{
50+
currentBuild.result = 'FAILURE'
51+
}
52+
53+
if(currentBuild.result != 'FAILURE')
54+
{
55+
stage 'Build Source'
56+
try
57+
{
58+
gitlabCommitStatus("Build")
59+
{
60+
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+'"'
61+
}
62+
63+
def files = findFiles(glob: '**/cireports/errorlogs/*.txt')
64+
65+
if(files.size() > 0)
66+
{
67+
currentBuild.result = 'FAILURE'
68+
}
69+
}
70+
catch(Exception e)
71+
{
72+
currentBuild.result = 'FAILURE'
73+
}
74+
}
75+
76+
stage 'Delete Workspace'
77+
78+
def files = findFiles(glob: '**/cireports/spellcheck/*.*')
79+
80+
if(files.size() > 0)
81+
{
82+
archiveArtifacts artifacts: 'cireports/', excludes: null
83+
}
84+
step([$class: 'WsCleanup']) }
85+
}
86+
}

0 commit comments

Comments
 (0)