Skip to content

Commit 134ea19

Browse files
author
yaroslaw.ekimov
committed
Merge branch 'master' into release
2 parents cce8d13 + 6686015 commit 134ea19

File tree

4 files changed

+27
-32
lines changed

4 files changed

+27
-32
lines changed

Jenkinsfile

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
parameters {
22
string(name: 'branch', defaultValue: 'master', description: 'branch to test')
33
string(name: 'testServerUrl', defaultValue: 'https://api-qa.aspose.cloud', description: 'server url')
4+
booleanParam(name: 'debugMode', defaultValue: 'false', description: 'start tests in debug mode')
45
}
56

67
def runtests(dockerImageVersion)
@@ -11,14 +12,14 @@ def runtests(dockerImageVersion)
1112
checkout([$class: 'GitSCM', branches: [[name: params.branch]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'LocalBranch', localBranch: "**"]], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '361885ba-9425-4230-950e-0af201d90547', url: 'https://git.auckland.dynabic.com/words-cloud/words-cloud-ruby.git']]])
1213
withCredentials([usernamePassword(credentialsId: '6839cbe8-39fa-40c0-86ce-90706f0bae5d', passwordVariable: 'AppKey', usernameVariable: 'AppSid')]) {
1314
sh 'mkdir -p Settings'
14-
sh 'echo "{\\"AppSid\\": \\"$AppSid\\",\\"AppKey\\": \\"$AppKey\\", \\"BaseUrl\\": \\"$testServerUrl\\"}" > Settings/servercreds.json'
15+
sh 'echo "{\\"AppSid\\": \\"$AppSid\\",\\"AppKey\\": \\"$AppKey\\", \\"BaseUrl\\": \\"$testServerUrl\\", \\"Debug\\" : $debugMode}" > Settings/servercreds.json'
1516
}
1617
}
1718

1819
docker.image('ruby:' + dockerImageVersion).inside('-u root'){
1920
stage('build'){
2021
sh "mkdir testReports"
21-
sh "gem install bundler && bundle install"
22+
sh "gem install bundler -v 2.0.2 && bundle install"
2223
}
2324

2425
stage('tests'){
@@ -57,28 +58,6 @@ node('words-linux') {
5758
runtests("2.5")
5859
} finally {
5960
cleanWs()
60-
}
61+
}
6162
}
62-
63-
64-
stage('wait for publishing'){
65-
timeout(time:1, unit:'DAYS') {
66-
input message:'Is packet already published'
67-
}
68-
}
69-
stage('Merge master to release'){
70-
if (params.branch.contains("master")) {
71-
checkout([$class: 'GitSCM', branches: [[name: '*/release']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'LocalBranch', localBranch: "**"]], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '361885ba-9425-4230-950e-0af201d90547', url: 'https://git.auckland.dynabic.com/words-cloud/words-cloud-ruby.git']]])
72-
sh "git config user.email '[email protected]'"
73-
sh "git config user.name 'jenkins'"
74-
sh "git checkout --merge release"
75-
sh "git reset --hard origin/release"
76-
sh "git merge --no-ff --allow-unrelated-histories origin/master"
77-
sh "git diff --name-status"
78-
sh 'git commit -am "Merged master branch to release" || exit 0'
79-
withCredentials([usernamePassword(credentialsId: '361885ba-9425-4230-950e-0af201d90547', passwordVariable: 'gitPass', usernameVariable: 'gitUsername')]) {
80-
sh "git push https://$gitUsername:$gitPass@git.auckland.dynabic.com/words-cloud/words-cloud-ruby.git release"
81-
}
82-
}
83-
}
8463
}

JenkinsfileRelease

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def testGemLocally()
5353

5454
stage('test gem locally'){
5555
sh "mkdir testReports"
56-
sh "gem install bundler && bundle install"
56+
sh "gem install bundler -v 2.0.2 && bundle install"
5757
try{
5858
sh 'rake test'
5959
} finally{
@@ -113,6 +113,21 @@ def publishGem()
113113
}
114114

115115
node('words-linux') {
116+
stage('Merge master to release'){
117+
if (params.branch.contains("master")) {
118+
checkout([$class: 'GitSCM', branches: [[name: '*/release']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'LocalBranch', localBranch: "**"]], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '361885ba-9425-4230-950e-0af201d90547', url: 'https://git.auckland.dynabic.com/words-cloud/words-cloud-ruby.git']]])
119+
sh "git config user.email '[email protected]'"
120+
sh "git config user.name 'jenkins'"
121+
sh "git checkout --merge release"
122+
sh "git reset --hard origin/release"
123+
sh "git merge --no-ff --allow-unrelated-histories origin/master"
124+
sh "git diff --name-status"
125+
sh 'git commit -am "Merged master branch to release" || exit 0'
126+
withCredentials([usernamePassword(credentialsId: '361885ba-9425-4230-950e-0af201d90547', passwordVariable: 'gitPass', usernameVariable: 'gitUsername')]) {
127+
sh "git push https://$gitUsername:[email protected]/words-cloud/words-cloud-ruby.git release"
128+
}
129+
}
130+
}
116131
try {
117132
testGemLocally()
118133
} finally {

tests/DocumentElements/tables_tests.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ def test_delete_table_row
9797
def test_get_border
9898
filename = 'TablesGet.docx'
9999
remote_name = 'TestGetBorder.docx'
100-
index = 0
100+
borderType = "Left"
101101

102102
upload_file File.join(local_test_folder, test_folder, filename), File.join(remote_test_folder, test_folder, remote_name)
103103

104-
request = GetBorderRequest.new remote_name, 'sections/0/tables/2/rows/0', index, remote_test_folder + test_folder
104+
request = GetBorderRequest.new remote_name, 'sections/0/tables/2/rows/0', borderType, remote_test_folder + test_folder
105105
result = @words_api.get_border request
106106
assert_equal FALSE, result.nil?
107107
end
@@ -439,11 +439,11 @@ def test_delete_border
439439
filename = 'TablesGet.docx'
440440
remote_name = 'TestDeleteBorder.docx'
441441
dest_name = remote_test_out + remote_name
442-
index = 0
442+
borderType = "Left"
443443

444444
upload_file File.join(local_test_folder, test_folder, filename), File.join(remote_test_folder, test_folder, remote_name)
445445

446-
request = DeleteBorderRequest.new remote_name, 'tables/1/rows/0/cells/0/', index, remote_test_folder + test_folder, :dest_file_name => dest_name
446+
request = DeleteBorderRequest.new remote_name, 'tables/1/rows/0/cells/0/', borderType, remote_test_folder + test_folder, :dest_file_name => dest_name
447447
result = @words_api.delete_border request
448448
assert_equal FALSE, result.nil?
449449
end
@@ -468,14 +468,14 @@ def test_delete_borders
468468
def test_update_border
469469
filename = 'TablesGet.docx'
470470
remote_name = 'TestUpdateBorder.docx'
471-
index = 0
471+
borderType = "Left"
472472
border = Border.new({:BorderType => 'Left', :Color => XmlColor.new({:Alpha => 2}),
473473
:DistanceFromText => 6, :LineStyle => 'DashDotStroker',
474474
:LineWith => 2, :Shadow => true})
475475

476476
upload_file File.join(local_test_folder, test_folder, filename), File.join(remote_test_folder, test_folder, remote_name)
477477

478-
request = UpdateBorderRequest.new remote_name, border, 'tables/1/rows/0/cells/0/', index, remote_test_folder + test_folder
478+
request = UpdateBorderRequest.new remote_name, border, 'tables/1/rows/0/cells/0/', borderType, remote_test_folder + test_folder
479479
result = @words_api.update_border request
480480
assert_equal FALSE, result.nil?
481481
end

tests/base_test_context.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def setup
3939
AsposeWordsCloud.configure do |config|
4040
config.api_key['api_key'] = creds['AppKey']
4141
config.api_key['app_sid'] = creds['AppSid']
42+
config.debugging = creds['Debug']
4243
config.host = creds['BaseUrl']
4344
end
4445
@words_api = WordsApi.new

0 commit comments

Comments
 (0)