Skip to content

Commit 6b2bf78

Browse files
Merge branch 'master' into release
2 parents d1fb5fe + 28c1b89 commit 6b2bf78

File tree

2 files changed

+47
-13
lines changed

2 files changed

+47
-13
lines changed

JenkinsfileRelease

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
parameters {
22
string(name: 'version', defaultValue: '19.9.0', description: 'version of sdk')
33
string(name: 'StartFromStep', defaultValue: '0', description: 'start step')
4-
string(name: 'testServerUrl', defaultValue: 'https://api-qa.aspose.cloud', description: 'server url')
4+
string(name: 'testServerUrl', defaultValue: 'https://api-qa.aspose.cloud', description: 'server url')
5+
string(name: 'credentialsId', defaultValue: '6839cbe8-39fa-40c0-86ce-90706f0bae5d', description: 'credentials id')
6+
string(name: 'releaseCredentialsId', defaultValue: 'f0c4f9b6-8ffe-4ea8-8981-e99263fdb788', description: 'release credentials id')
7+
string(name: 'serverToDeploy', defaultValue: '-DuseStageRepo=true', description: 'possible values are -DuseStageRepo=true or false')
58
}
69
node('words-linux') {
710
try {
@@ -23,15 +26,15 @@ node('words-linux') {
2326
stage('1:checkout'){
2427
if (params.StartFromStep.toInteger() < 2) {
2528
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-java.git']]])
26-
withCredentials([usernamePassword(credentialsId: '6839cbe8-39fa-40c0-86ce-90706f0bae5d', passwordVariable: 'ClientSecret', usernameVariable: 'ClientId')]) {
29+
withCredentials([usernamePassword(credentialsId: params.credentialsId, passwordVariable: 'ClientSecret', usernameVariable: 'ClientId')]) {
2730
sh 'git checkout release'
2831
sh 'mkdir -p Settings'
2932
sh 'echo "{\\"ClientId\\": \\"$ClientId\\",\\"ClientSecret\\": \\"$ClientSecret\\", \\"BaseUrl\\": \\"https://auckland-words-cloud-staging.dynabic.com\\"}" > Settings/servercreds.json'
3033
sh "git config user.email \"[email protected]\""
3134
sh "git config user.name \"jenkins\""
3235
}
33-
withCredentials([usernamePassword(credentialsId: 'f0c4f9b6-8ffe-4ea8-8981-e99263fdb788', passwordVariable: 'mavenPass', usernameVariable: 'mavenUser')]) {
34-
sh 'echo "<settings xmlns=\\"http://maven.apache.org/SETTINGS/1.0.0\\" \\n xmlns:xsi=\\"http://www.w3.org/2001/XMLSchema-instance\\" \\n xsi:schemaLocation=\\"http://maven.apache.org/SETTINGS/1.0.0\\"> \\n<servers> \\n <server> \\n<id>aspose</id>\\n<username>${mavenUser}</username>\\n<password>${mavenPass}</password>\\n</server>\\n</servers>\\n</settings>" > wordsSettings.xml'
36+
withCredentials([usernamePassword(credentialsId: params.releaseCredentialsId, passwordVariable: 'mavenPass', usernameVariable: 'mavenUser')]) {
37+
sh 'echo "<settings xmlns=\\"http://maven.apache.org/SETTINGS/1.0.0\\" \\n xmlns:xsi=\\"http://www.w3.org/2001/XMLSchema-instance\\" \\n xsi:schemaLocation=\\"http://maven.apache.org/SETTINGS/1.0.0\\"> \\n<servers> \\n <server> \\n<id>params.serverToDeploy</id>\\n<username>${mavenUser}</username>\\n<password>${mavenPass}</password>\\n</server>\\n</servers>\\n</settings>" > wordsSettings.xml'
3538
}
3639
}
3740
}
@@ -41,12 +44,12 @@ node('words-linux') {
4144
withCredentials([usernamePassword(credentialsId: '361885ba-9425-4230-950e-0af201d90547', passwordVariable: 'gitPass', usernameVariable: 'gitUsername')]) {
4245
docker.image('maven:3.6.2-jdk-8').inside{
4346
stage('deploy'){
44-
withCredentials([usernamePassword(credentialsId: '6839cbe8-39fa-40c0-86ce-90706f0bae5d', passwordVariable: 'ClientSecret', usernameVariable: 'ClientId')]) {
47+
withCredentials([usernamePassword(credentialsId: params.credentialsId, passwordVariable: 'ClientSecret', usernameVariable: 'ClientId')]) {
4548
sh 'mkdir -p Settings'
4649
sh 'echo "{\\"ClientId\\": \\"$ClientId\\",\\"ClientSecret\\": \\"$ClientSecret\\", \\"BaseUrl\\": \\"$testServerUrl\\"}" > Settings/servercreds.json'
4750
}
4851
sh 'cat wordsSettings.xml'
49-
sh "mvn --settings wordsSettings.xml deploy -Dmaven.javadoc.skip=true -DcheckModificationExcludeList=wordsSettings.xml,Settings/servercreds.json"
52+
sh "mvn --settings wordsSettings.xml deploy -Dmaven.javadoc.skip=true -DcheckModificationExcludeList=wordsSettings.xml,Settings/servercreds.json -DuseStageRepo=true"
5053
}
5154
}
5255
}

pom.xml

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@
1414
<tag>HEAD</tag>
1515
</scm>
1616

17-
<distributionManagement>
18-
<repository>
19-
<id>aspose</id>
20-
<url>https://repository.aspose.cloud/internal</url>
21-
</repository>
22-
</distributionManagement>
23-
2417
<licenses>
2518
<license>
2619
<name>MIT License</name>
@@ -39,6 +32,13 @@
3932
</developers>
4033

4134
<build>
35+
<extensions>
36+
<extension>
37+
<groupId>com.github.seahen</groupId>
38+
<artifactId>maven-s3-wagon</artifactId>
39+
<version>1.3.3</version>
40+
</extension>
41+
</extensions>
4242
<pluginManagement>
4343
<plugins>
4444
<plugin>
@@ -215,6 +215,37 @@
215215
</build>
216216

217217
<profiles>
218+
<profile>
219+
<id>stage-repository</id>
220+
<activation>
221+
<property>
222+
<name>useStageRepo</name>
223+
<value>true</value>
224+
</property>
225+
</activation>
226+
<distributionManagement>
227+
<repository>
228+
<id>aspose-cloud-s3-repo-ci-qa</id>
229+
<url>s3://data-qa.repository.aspose.cloud/repo</url>
230+
</repository>
231+
</distributionManagement>
232+
</profile>
233+
234+
<profile>
235+
<id>production-repository</id>
236+
<activation>
237+
<property>
238+
<name>useStageRepo</name>
239+
<value>false</value>
240+
</property>
241+
</activation>
242+
<distributionManagement>
243+
<repository>
244+
<id>aspose-cloud-s3-repo-ci</id>
245+
<url>s3://data.repository.aspose.cloud/repo</url>
246+
</repository>
247+
</distributionManagement>
248+
</profile>
218249
<profile>
219250
<id>sign-artifacts</id>
220251
<build>

0 commit comments

Comments
 (0)