1
- properties([
2
- gitLabConnection('gitlab')
3
- ])
4
-
5
- node('win2019') {
6
- try {
7
- env.SDK_VERSION = powershell(returnStdout: true, script:'$re = (ConvertFrom-Json -InputObject (New-Object System.Net.WebClient).DownloadString("https://api.aspose.cloud/v4.0/words/swagger/spec")).info.version -match "^(\\d+)\\.(\\d+)"; $version = $matches[1] + ("{0:d2}" -f [int]$matches[2]); echo ("v" + $version + ".0.0")').trim()
8
-
9
- gitlabCommitStatus("checkout") {
10
- stage('checkout'){
11
- checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'LocalBranch', localBranch: "**"]], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '361885ba-9425-4230-950e-0af201d90547', url: 'https://git.auckland.dynabic.com/words-cloud/words-cloud-go.git']]])
12
- }
13
- }
14
-
15
- gitlabCommitStatus("Merge master to release") {
16
- stage('Merge master to release'){
17
- 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-go.git']]])
18
- bat "git config user.email 'jenkins.aspose@gmail.com'"
19
- bat "git config user.name 'jenkins'"
20
- bat "git checkout --merge release"
21
- bat "git reset --hard origin/release"
22
- bat "git merge --no-ff --allow-unrelated-histories origin/master"
23
- bat "git diff --name-status"
24
- bat 'git commit -am "Merged master branch to release" || exit 0'
25
- withCredentials([usernamePassword(credentialsId: '361885ba-9425-4230-950e-0af201d90547', passwordVariable: 'gitPass', usernameVariable: 'gitUsername')]) {
26
- bat "git push https://$gitUsername:$gitPass@git.auckland.dynabic.com/words-cloud/words-cloud-go.git release"
27
- }
28
- }
29
- }
30
-
31
- gitlabCommitStatus("add version tag") {
32
- stage('add version tag') {
33
- bat "git config user.email 'jenkins.aspose@gmail.com'"
34
- bat "git config user.name 'jenkins'"
35
-
36
- bat "git tag -a %SDK_VERSION% -m \"version %SDK_VERSION%\""
37
-
38
- withCredentials([usernamePassword(credentialsId: '361885ba-9425-4230-950e-0af201d90547', passwordVariable: 'gitPass', usernameVariable: 'gitUsername')]) {
39
- bat "git push https://%gitUsername%:%gitPass%@git.auckland.dynabic.com/words-cloud/words-cloud-go.git %SDK_VERSION%"
40
- }
41
- }
42
- }
43
- } finally {
44
- deleteDir()
45
- }
1
+ properties([
2
+ gitLabConnection('gitlab')
3
+ ])
4
+
5
+ node('win2019') {
6
+ try {
7
+ env.SDK_VERSION = powershell(returnStdout: true, script:'$re = (ConvertFrom-Json -InputObject (New-Object System.Net.WebClient).DownloadString("https://api.aspose.cloud/v4.0/words/swagger/spec")).info.version -match "^(\\d+)\\.(\\d+)"; $version = $matches[1] + ("{0:d2}" -f [int]$matches[2]); echo ("v" + $version + ".0.0")').trim()
8
+
9
+ gitlabCommitStatus("checkout") {
10
+ stage('checkout'){
11
+ checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'LocalBranch', localBranch: "**"]], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '361885ba-9425-4230-950e-0af201d90547', url: 'https://git.auckland.dynabic.com/words-cloud/words-cloud-go.git']]])
12
+ }
13
+ }
14
+
15
+ gitlabCommitStatus("Merge master to release") {
16
+ stage('Merge master to release'){
17
+ 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-go.git']]])
18
+ bat "git config user.email 'jenkins.aspose@gmail.com'"
19
+ bat "git config user.name 'jenkins'"
20
+ bat "git checkout --merge release"
21
+ bat "git reset --hard origin/release"
22
+ bat "git merge --no-ff --allow-unrelated-histories origin/master"
23
+ bat "git diff --name-status"
24
+ bat 'git commit -am "Merged master branch to release" || exit 0'
25
+ withCredentials([usernamePassword(credentialsId: '361885ba-9425-4230-950e-0af201d90547', passwordVariable: 'gitPass', usernameVariable: 'gitUsername')]) {
26
+ bat "git push https://$gitUsername:$gitPass@git.auckland.dynabic.com/words-cloud/words-cloud-go.git release"
27
+ }
28
+ }
29
+ }
30
+
31
+ gitlabCommitStatus("add version tag") {
32
+ stage('add version tag') {
33
+ bat "git config user.email 'jenkins.aspose@gmail.com'"
34
+ bat "git config user.name 'jenkins'"
35
+
36
+ bat "git tag -a %SDK_VERSION% -m \"version %SDK_VERSION%\""
37
+
38
+ withCredentials([usernamePassword(credentialsId: '361885ba-9425-4230-950e-0af201d90547', passwordVariable: 'gitPass', usernameVariable: 'gitUsername')]) {
39
+ bat "git push https://%gitUsername%:%gitPass%@git.auckland.dynabic.com/words-cloud/words-cloud-go.git %SDK_VERSION%"
40
+ }
41
+ }
42
+ }
43
+ } finally {
44
+ deleteDir()
45
+ }
46
46
}
0 commit comments