Skip to content

Commit ae18878

Browse files
Merge remote-tracking branch 'remotes/origin/master' into release
2 parents 4318f26 + 0f0a253 commit ae18878

File tree

1 file changed

+59
-61
lines changed

1 file changed

+59
-61
lines changed

Jenkinsfile

Lines changed: 59 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -16,75 +16,73 @@ def packageTesting = false
1616

1717
node('words-linux') {
1818
cleanWs()
19-
if (!params.branch.contains("release")) {
20-
dir('dart') {
21-
try {
22-
stage('checkout'){
23-
checkout([$class: 'GitSCM', branches: [[name: params.branch]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '361885ba-9425-4230-950e-0af201d90547', url: 'https://git.auckland.dynabic.com/words-cloud/words-cloud-dart.git']]])
19+
dir('dart') {
20+
try {
21+
stage('checkout'){
22+
checkout([$class: 'GitSCM', branches: [[name: params.branch]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '361885ba-9425-4230-950e-0af201d90547', url: 'https://git.auckland.dynabic.com/words-cloud/words-cloud-dart.git']]])
2423

25-
sh 'git show -s HEAD > gitMessage'
26-
def commitMessage = readFile('gitMessage').trim()
27-
echo commitMessage
28-
needToBuild = params.ignoreCiSkip || !commitMessage.contains('[ci skip]')
29-
packageTesting = params.packageTesting
30-
sh 'git clean -fdx'
31-
32-
if (needToBuild) {
33-
withCredentials([usernamePassword(credentialsId: params.credentialsId, passwordVariable: 'ClientSecret', usernameVariable: 'ClientId')]) {
34-
sh 'mkdir -p settings'
35-
sh 'echo "{\\"ClientId\\": \\"$ClientId\\", \\"ClientSecret\\": \\"$ClientSecret\\",\\"BaseUrl\\": \\"$apiUrl\\"}" > settings/servercreds.json'
36-
}
24+
sh 'git show -s HEAD > gitMessage'
25+
def commitMessage = readFile('gitMessage').trim()
26+
echo commitMessage
27+
needToBuild = params.ignoreCiSkip || !commitMessage.contains('[ci skip]')
28+
packageTesting = params.packageTesting
29+
sh 'git clean -fdx'
30+
31+
if (needToBuild || packageTesting) {
32+
withCredentials([usernamePassword(credentialsId: params.credentialsId, passwordVariable: 'ClientSecret', usernameVariable: 'ClientId')]) {
33+
sh 'mkdir -p settings'
34+
sh 'echo "{\\"ClientId\\": \\"$ClientId\\", \\"ClientSecret\\": \\"$ClientSecret\\",\\"BaseUrl\\": \\"$apiUrl\\"}" > settings/servercreds.json'
3735
}
3836
}
39-
40-
if (packageTesting) {
41-
docker.image('google/dart:2.14').inside {
42-
stage('prepare'){
43-
sh "rm -rf lib"
44-
sh "cp ./pubspec_package_testing.yaml ./pubspec.yaml"
45-
sh "dart pub add aspose_words_cloud"
46-
sh "pub get"
47-
sh "pub global activate junitreport"
48-
}
49-
50-
stage('lint'){
51-
sh "dartanalyzer --fatal-infos --fatal-warnings --options analysis_options.yaml ."
52-
}
37+
}
38+
39+
if (packageTesting) {
40+
docker.image('google/dart:2.14').inside {
41+
stage('prepare'){
42+
sh "rm -rf lib"
43+
sh "cp ./pubspec_package_testing.yaml ./pubspec.yaml"
44+
sh "dart pub add aspose_words_cloud"
45+
sh "pub get"
46+
sh "pub global activate junitreport"
47+
}
5348

54-
stage('tests'){
55-
try {
56-
sh "pub run test test/aspose_words_cloud_tests.dart --concurrency=1 --no-color --reporter expanded --file-reporter json:testReport.json"
57-
} finally {
58-
sh "pub global run junitreport:tojunit --input testReport.json --output testReport.xml"
59-
junit 'testReport.xml'
60-
}
61-
}
62-
}
63-
}
64-
else if (needToBuild) {
65-
docker.image('google/dart:2.14').inside {
66-
stage('prepare'){
67-
sh "pub get"
68-
sh "pub global activate junitreport"
69-
}
70-
71-
stage('lint'){
72-
sh "dartanalyzer --fatal-infos --fatal-warnings --options analysis_options.yaml ."
49+
stage('lint'){
50+
sh "dartanalyzer --fatal-infos --fatal-warnings --options analysis_options.yaml ."
51+
}
52+
53+
stage('tests'){
54+
try {
55+
sh "pub run test test/aspose_words_cloud_tests.dart --concurrency=1 --no-color --reporter expanded --file-reporter json:testReport.json"
56+
} finally {
57+
sh "pub global run junitreport:tojunit --input testReport.json --output testReport.xml"
58+
junit 'testReport.xml'
7359
}
60+
}
61+
}
62+
}
63+
else if (needToBuild) {
64+
docker.image('google/dart:2.14').inside {
65+
stage('prepare'){
66+
sh "pub get"
67+
sh "pub global activate junitreport"
68+
}
7469

75-
stage('tests'){
76-
try {
77-
sh "pub run test test/aspose_words_cloud_tests.dart --concurrency=1 --no-color --reporter expanded --file-reporter json:testReport.json"
78-
} finally {
79-
sh "pub global run junitreport:tojunit --input testReport.json --output testReport.xml"
80-
junit 'testReport.xml'
81-
}
70+
stage('lint'){
71+
sh "dartanalyzer --fatal-infos --fatal-warnings --options analysis_options.yaml ."
72+
}
73+
74+
stage('tests'){
75+
try {
76+
sh "pub run test test/aspose_words_cloud_tests.dart --concurrency=1 --no-color --reporter expanded --file-reporter json:testReport.json"
77+
} finally {
78+
sh "pub global run junitreport:tojunit --input testReport.json --output testReport.xml"
79+
junit 'testReport.xml'
8280
}
83-
}
84-
}
85-
} finally {
86-
deleteDir()
81+
}
82+
}
8783
}
84+
} finally {
85+
deleteDir()
8886
}
8987
}
9088
}

0 commit comments

Comments
 (0)