11parameters {
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}
69node('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 }
0 commit comments